12.19 异常捕获补充
在自定义异常中,状态值默认200,
注意一般成功状态值为200,失败状态值定位403 405 或者其他
|
1
2
3
|
public class ResponseBanExcetion extends RuntimeException{} |
异常捕获及状态值更改
|
1
2
3
4
|
@ExceptionHandler(value = ResponseBanExcetion.class)@ResponseStatus(HttpStatus.FORBIDDEN) public ModelAndView handlerAuthorizeException() { } |
浙公网安备 33010602011771号