|
@@ -36,7 +36,7 @@ public class LoggingAspect {
|
|
|
}
|
|
|
|
|
|
@Around("@annotation(annotation)")
|
|
|
- public Object around(ProceedingJoinPoint joinPoint, SystemLog annotation) {
|
|
|
+ public Object around(ProceedingJoinPoint joinPoint, SystemLog annotation) throws Throwable {
|
|
|
Class<?> clazz = AopUtils.getTargetClass(joinPoint.getTarget());
|
|
|
SystemLog systemLog = clazz.getAnnotation(SystemLog.class);
|
|
|
String title = annotation.value();
|
|
@@ -49,7 +49,7 @@ public class LoggingAspect {
|
|
|
.params(joinPoint.getArgs() == null ? Objects.toString(request.getParameterMap()) : JSONUtil.toJsonStr(joinPoint.getArgs()));
|
|
|
StopWatch watch = new StopWatch();
|
|
|
watch.start();
|
|
|
- Object result = null;
|
|
|
+ Object result;
|
|
|
try {
|
|
|
result = joinPoint.proceed();
|
|
|
if (annotation.saveResult()) {
|
|
@@ -57,6 +57,8 @@ public class LoggingAspect {
|
|
|
}
|
|
|
} catch (Throwable throwable) {
|
|
|
builder.exception(ExceptionUtil.stacktraceToString(throwable));
|
|
|
+ builder.hasException(true);
|
|
|
+ throw throwable;
|
|
|
} finally {
|
|
|
watch.stop();
|
|
|
builder.executeTime(watch.getTotalTimeMillis());
|