1234567891011121314151617181920 |
- package com.fdkankan.common.exception;
- import com.fdkankan.common.constant.ErrorCode;
- import lombok.AllArgsConstructor;
- import lombok.Data;
- /**
- * 自定义业务异常类
- */
- @Data
- @AllArgsConstructor
- public class BusinessException extends RuntimeException {
- private int code;
- private String message;
- public BusinessException (ErrorCode errorCode){
- this.code = errorCode.code();
- this.message = errorCode.message();
- }
- }
|