You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
550 B
Java

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;
}
}