Commit 24329497 authored by jiaorz's avatar jiaorz

异常处理

parent 9668bcf5
......@@ -69,7 +69,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
if(0 == ex.getStatus()) {
response.setStatus(500);
}
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex.getStackTrace().toString());
return new BaseResponse(ex.getStatus(), ex.getMessage());
}
......@@ -85,7 +85,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + stringWriter.toString());
return new BaseResponse(5000, "Server exception: " + ex.getMessage());
}
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex.getStackTrace().toString());
return new BaseResponse(CommonConstants.EX_OTHER_CODE, ex.getMessage());
}
}
......@@ -38,7 +38,7 @@ public class PlatformExceptionHandler {
return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage());
}
log.error("Server exception: ", e);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + e);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + e.getStackTrace().toString());
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