{
"timestamp": 1577621334300,
"status": 500,
"error": "Internal Server Error",
"exception": "com.gjx.sell.exception.SellException",
"message": "订单状态错误",
"path": "/sell/buyer/order/cancel"
}
这个是我们定义的返回。2个问题:
1.为什么没有我们自定义异常中的code呢?
public class SellException extends RuntimeException {
private Integer code;
public SellException(ResultEnum resultEnum){
super(resultEnum.getMessage());
this.code = resultEnum.getCode();
}
public SellException(Integer code, String message) {
super(message);
this.code = code;
}
}
2.如果我不想返回某几个值(如:exception timestamp等)要怎么做呢?