Commit 91b42574 authored by jiaorz's avatar jiaorz

全局异常

parent c8d5c616
...@@ -57,7 +57,7 @@ public class GlobalExceptionHandler { ...@@ -57,7 +57,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
public ObjectRestResponse<?> exceptionHandler(Exception e){ public ObjectRestResponse<?> exceptionHandler(Exception e){
Throwable cause = e.getCause(); Throwable cause = e.getCause();
if(cause != null && cause.toString().contains("ExceptionLoggingFilter")) { if(cause != null && cause.toString().contains("Exception")) {
logger.error(cause.getMessage(), e); logger.error(cause.getMessage(), e);
return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage()); return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage());
} }
......
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