Commit 08b82e17 authored by yanzg's avatar yanzg

修复bug

parent 64d49fed
...@@ -207,12 +207,11 @@ public class BaseRequestAspect { ...@@ -207,12 +207,11 @@ public class BaseRequestAspect {
} else if (result != null) { } else if (result != null) {
responseResult = ResponseResult.result(result); responseResult = ResponseResult.result(result);
} }
if (isLogDisplay || isLogDatabase) {
// 执行时间 // 执行时间
if (resultEx != null) { if (resultEx != null) {
responseResult = ExceptionHelper.getError(resultEx); responseResult = ExceptionHelper.getError(resultEx);
resultEx.printStackTrace();
} }
if (isLogDisplay || isLogDatabase) {
String json = JsonHelper.serialize(responseResult); String json = JsonHelper.serialize(responseResult);
if (isLogDisplay) { if (isLogDisplay) {
Log.error(cls, resultEx, "%s [ %s ] time %d ms, result: %s", tag, url, time, getMaxString(json)); Log.error(cls, resultEx, "%s [ %s ] time %d ms, result: %s", tag, url, time, getMaxString(json));
...@@ -220,6 +219,9 @@ public class BaseRequestAspect { ...@@ -220,6 +219,9 @@ public class BaseRequestAspect {
if (isLogDatabase) { if (isLogDatabase) {
logLocal.result(log, responseResult.getCode(), json); logLocal.result(log, responseResult.getCode(), json);
} }
} else if (resultEx != null) {
responseResult = ExceptionHelper.getError(resultEx);
resultEx.printStackTrace();
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
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