package com.backendsys.exception;

public class CustException extends RuntimeException {
    private Integer errorCode;

    private Object errorObject;

    public CustException(String message) {
        super(message);
    }
    public CustException(String message, Integer errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    // 可以添加更多的构造函数，以支持不同的参数，例如错误详情等
    public CustException(String message, Integer errorCode, Object errorObject) {
        super(message);
        this.errorCode = errorCode;
        this.errorObject = errorObject;
    }

    // 获取错误代码的方法
    public Integer getErrorCode() {
        return errorCode;
    }

    public Object getErrorObject() { return errorObject; }
}
