Commit 2fedd938 by weisong

change order

parent 12614ee5
...@@ -45,11 +45,7 @@ public class GlobalExceptionHandler { ...@@ -45,11 +45,7 @@ public class GlobalExceptionHandler {
/** /**
* 处理其他异常 * 处理其他异常
*/ */
@ExceptionHandler(Exception.class)
public ApiResult<String> handleException(Exception e, HttpServletRequest request) {
log.error("系统异常: {},请求URL: {}", e.getMessage(), request.getRequestURI(), e);
return ApiResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), GlobalErrorCodeConstants.SYSTEM_ERROR.getMsg());
}
@ExceptionHandler(BusinessException.class) @ExceptionHandler(BusinessException.class)
public ApiResult<String> handleBusinessException(BusinessException e, HttpServletRequest request) { public ApiResult<String> handleBusinessException(BusinessException e, HttpServletRequest request) {
...@@ -62,4 +58,10 @@ public class GlobalExceptionHandler { ...@@ -62,4 +58,10 @@ public class GlobalExceptionHandler {
log.error("空指针异常: {},请求URL: {}", e.getMessage(), request.getRequestURI(), e); log.error("空指针异常: {},请求URL: {}", e.getMessage(), request.getRequestURI(), e);
return ApiResult.error(GlobalErrorCodeConstants.SYSTEM_ERROR.getCode(), GlobalErrorCodeConstants.SYSTEM_ERROR.getMsg()); return ApiResult.error(GlobalErrorCodeConstants.SYSTEM_ERROR.getCode(), GlobalErrorCodeConstants.SYSTEM_ERROR.getMsg());
} }
@ExceptionHandler(Exception.class)
public ApiResult<String> handleException(Exception e, HttpServletRequest request) {
log.error("系统异常: {},请求URL: {}", e.getMessage(), request.getRequestURI(), e);
return ApiResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), GlobalErrorCodeConstants.SYSTEM_ERROR.getMsg());
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment