package com.brilliance.isc.exception;


import com.brilliance.isc.constant.BizCode;

public class RestBizException extends RuntimeException{
    protected String code;
    protected String message;
    public RestBizException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public RestBizException(String message){
        this.code = BizCode.BIZ_EXCEPTION;
        this.message = message;
    }

    public RestBizException(String code, String message, Throwable cause){
        super(message,cause);
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getErrorCode(){
        return getCode();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static RestBizException TOKEN_EXPIRED = new RestBizException(BizCode.TOKEN_EXPIRED,"Token Expired !");
}
