diff --git a/simpleclient/src/main/java/io/prometheus/client/Histogram.java b/simpleclient/src/main/java/io/prometheus/client/Histogram.java index 2b289806a..1d8b1a2fa 100644 --- a/simpleclient/src/main/java/io/prometheus/client/Histogram.java +++ b/simpleclient/src/main/java/io/prometheus/client/Histogram.java @@ -219,6 +219,8 @@ public E time(Callable timeable) { try { return timeable.call(); + } catch (RuntimeException e) { + throw e; } catch (Exception e) { throw new RuntimeException(e); } finally { diff --git a/simpleclient/src/main/java/io/prometheus/client/Summary.java b/simpleclient/src/main/java/io/prometheus/client/Summary.java index a341f2515..4d79e558a 100644 --- a/simpleclient/src/main/java/io/prometheus/client/Summary.java +++ b/simpleclient/src/main/java/io/prometheus/client/Summary.java @@ -226,6 +226,8 @@ public E time(Callable timeable) { try { return timeable.call(); + } catch (RuntimeException e) { + throw e; } catch (Exception e) { throw new RuntimeException(e); } finally {