Skip to content

Commit ea79e74

Browse files
Merge branch '1.13.x'
2 parents b410174 + 35807f9 commit ea79e74

File tree

2 files changed

+177
-158
lines changed

2 files changed

+177
-158
lines changed

micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,19 @@ private Object processWithTimer(ProceedingJoinPoint pjp, Timed timed, String met
221221
return ((CompletionStage<?>) pjp.proceed()).whenComplete(
222222
(result, throwable) -> record(pjp, timed, metricName, sample, getExceptionTag(throwable)));
223223
}
224-
catch (Exception ex) {
225-
record(pjp, timed, metricName, sample, ex.getClass().getSimpleName());
226-
throw ex;
224+
catch (Throwable e) {
225+
record(pjp, timed, metricName, sample, e.getClass().getSimpleName());
226+
throw e;
227227
}
228228
}
229229

230230
String exceptionClass = DEFAULT_EXCEPTION_TAG_VALUE;
231231
try {
232232
return pjp.proceed();
233233
}
234-
catch (Exception ex) {
235-
exceptionClass = ex.getClass().getSimpleName();
236-
throw ex;
234+
catch (Throwable e) {
235+
exceptionClass = e.getClass().getSimpleName();
236+
throw e;
237237
}
238238
finally {
239239
record(pjp, timed, metricName, sample, exceptionClass);
@@ -293,9 +293,9 @@ private Object processWithLongTaskTimer(ProceedingJoinPoint pjp, Timed timed, St
293293
return ((CompletionStage<?>) pjp.proceed())
294294
.whenComplete((result, throwable) -> sample.ifPresent(this::stopTimer));
295295
}
296-
catch (Exception ex) {
296+
catch (Throwable e) {
297297
sample.ifPresent(this::stopTimer);
298-
throw ex;
298+
throw e;
299299
}
300300
}
301301

0 commit comments

Comments
 (0)