1.编写自己捕获异常的包装类
标注绿色的是自己最近写的包装类
BusinessExceptionNew 类
package com.aostar.trade.common.ExceptionHandler;
import lombok.Data;
/**
* @author jay
* @Description: 自定义业务异常类
* @date 2021/6/23 14:58
*/
@Data
public class BusinessExceptionNew extends RuntimeException {
/**
* 错误编码
*/
private String code;
public BusinessExceptionNew() {
super();
}
public BusinessExceptionNew(String message) {
super(message);
}
public BusinessExceptionNew(String code, String message) {
super(message);
this.code = code;
}
public BusinessExceptionNew(Throwable cause) {
super(cause);
}
public BusinessExceptionNew(String message, Throwable cause) {
super(message, cause);
}
public BusinessExceptionNew(String message, Throwable cau