From 6143aab9ac8ab171d567ff362dbcfe966a997bc6 Mon Sep 17 00:00:00 2001 From: Christian Schlichtherle Date: Thu, 20 Jun 2019 12:44:19 +0400 Subject: [PATCH 1/2] Don't wrap a RuntimeException in another RuntimeException. Signed-off-by: Christian Schlichtherle --- simpleclient/src/main/java/io/prometheus/client/Histogram.java | 2 ++ 1 file changed, 2 insertions(+) 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 { From 058655ed1a362307b46ac0bbe80627e6f2e2b5b2 Mon Sep 17 00:00:00 2001 From: Christian Schlichtherle Date: Thu, 20 Jun 2019 12:46:34 +0400 Subject: [PATCH 2/2] Don't wrap a RuntimeException in another RuntimeException. Signed-off-by: Christian Schlichtherle --- simpleclient/src/main/java/io/prometheus/client/Summary.java | 2 ++ 1 file changed, 2 insertions(+) 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 {