错误日志修改
This commit is contained in:
@@ -65,7 +65,11 @@ public class SyncLogAspect {
|
|||||||
try {
|
try {
|
||||||
result = pjp.proceed();
|
result = pjp.proceed();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
entity.setErrorMsg(truncate(t.getMessage(), MAX_ERROR_MSG));
|
String msg = t.getMessage();
|
||||||
|
if (msg == null || msg.trim().isEmpty()) {
|
||||||
|
msg = t.getClass().getName();
|
||||||
|
}
|
||||||
|
entity.setErrorMsg(truncate(msg, MAX_ERROR_MSG));
|
||||||
entity.setStatus(0);
|
entity.setStatus(0);
|
||||||
syncLogService.saveAsync(entity);
|
syncLogService.saveAsync(entity);
|
||||||
throw t;
|
throw t;
|
||||||
|
|||||||
@@ -72,7 +72,11 @@ public class SysOperationLogAspect {
|
|||||||
return result;
|
return result;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
entity.setStatusCode(500);
|
entity.setStatusCode(500);
|
||||||
entity.setErrorMsg(truncate(e.getMessage(), 2000));
|
String msg = e.getMessage();
|
||||||
|
if (msg == null || msg.trim().isEmpty()) {
|
||||||
|
msg = e.getClass().getName();
|
||||||
|
}
|
||||||
|
entity.setErrorMsg(truncate(msg, 2000));
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
entity.setCostTime(System.currentTimeMillis() - start);
|
entity.setCostTime(System.currentTimeMillis() - start);
|
||||||
|
|||||||
Reference in New Issue
Block a user