package com.xjgs.exception; /** * @description: 自定义的异常类 * @author: ChenJ * @date: 2022/5/9 17:29 * @param: * @return: **/ public class BusinessException extends Exception { /** * 枚举类型,内含状态码code和信息msg */ private final ExceptionCode exceptionCode; public ExceptionCode getExceptionCode() { return exceptionCode; } public BusinessException(ExceptionCode exceptionCode) { super(exceptionCode.getMessage()); this.exceptionCode = exceptionCode; } }