|
|
@ -71,6 +71,7 @@ public class WebMvcConfigurer extends WebMvcConfigurerAdapter { |
|
|
|
} else if (e instanceof ServletException) { |
|
|
|
} else if (e instanceof ServletException) { |
|
|
|
result.setCode(ResultCode.FAIL).setMessage(e.getMessage()); |
|
|
|
result.setCode(ResultCode.FAIL).setMessage(e.getMessage()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
result.setCode(ResultCode.INTERNAL_SERVER_ERROR).setMessage("接口 [" + request.getRequestURI() + "] 内部错误,请联系管理员"); |
|
|
|
String message; |
|
|
|
String message; |
|
|
|
if (handler instanceof HandlerMethod) { |
|
|
|
if (handler instanceof HandlerMethod) { |
|
|
|
HandlerMethod handlerMethod = (HandlerMethod) handler; |
|
|
|
HandlerMethod handlerMethod = (HandlerMethod) handler; |
|
|
@ -82,8 +83,7 @@ public class WebMvcConfigurer extends WebMvcConfigurerAdapter { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
message = e.getMessage(); |
|
|
|
message = e.getMessage(); |
|
|
|
} |
|
|
|
} |
|
|
|
result.setCode(ResultCode.INTERNAL_SERVER_ERROR).setMessage(message); |
|
|
|
logger.error(message, e); |
|
|
|
logger.error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
responseResult(response, result); |
|
|
|
responseResult(response, result); |
|
|
|
return new ModelAndView(); |
|
|
|
return new ModelAndView(); |
|
|
|