异常处理

This commit is contained in:
Captain.B 2020-03-03 14:17:33 +08:00
parent f12614199b
commit 07f286322d
1 changed files with 3 additions and 2 deletions

View File

@ -23,8 +23,9 @@ public class RestControllerExceptionHandler {
@ExceptionHandler(MSException.class)
public ResultHolder f2cExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
public ResultHolder msExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) {
// 自定义异常返回200
response.setStatus(HttpStatus.OK.value());
return ResultHolder.error(e.getMessage());
}
}