Skip to content

Commit ef16c43

Browse files
Don't wrap a RuntimeException in another RuntimeException. (#488)
* Don't wrap a RuntimeException in another RuntimeException. Signed-off-by: Christian Schlichtherle <christian@schlichtherle.de>
1 parent b61dd23 commit ef16c43

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

simpleclient/src/main/java/io/prometheus/client/Histogram.java

+2
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public <E> E time(Callable<E> timeable) {
219219

220220
try {
221221
return timeable.call();
222+
} catch (RuntimeException e) {
223+
throw e;
222224
} catch (Exception e) {
223225
throw new RuntimeException(e);
224226
} finally {

simpleclient/src/main/java/io/prometheus/client/Summary.java

+2
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ public <E> E time(Callable<E> timeable) {
226226

227227
try {
228228
return timeable.call();
229+
} catch (RuntimeException e) {
230+
throw e;
229231
} catch (Exception e) {
230232
throw new RuntimeException(e);
231233
} finally {

0 commit comments

Comments
 (0)