public class BaseRuntimeException extends RuntimeException {
    private final int code;

    public BaseRuntimeException(StatusCode statusCode) {
        this(statusCode.getStatusCode(), statusCode.getStatusMessage());
    }

    public BaseRuntimeException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }
}

 

相关文章:

  • 2022-02-10
  • 2022-02-10
  • 2021-07-31
  • 2021-07-12
  • 2021-12-31
  • 2021-10-24
  • 2021-12-17
猜你喜欢
  • 2022-02-10
  • 2022-03-10
  • 2021-08-30
相关资源
相似解决方案