package com.cim.idm.exception;

public class GlobalException extends RuntimeException {

    //错误码
    private int errorCode = 500;

    //默认构造函数
    public GlobalException() {
    }

    //带错误消息构造
    public GlobalException(String message) {
        super(message);
    }
    //带错误消息+异常构造
    public GlobalException(String message, Throwable cause) {
        super(message, cause);
    }

    //支持错误码构造
    public GlobalException(int errorCode,String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
}
