Skip to content

Commit

Permalink
Don't wrap a RuntimeException in another RuntimeException. (#488)
Browse files Browse the repository at this point in the history
* Don't wrap a RuntimeException in another RuntimeException.

Signed-off-by: Christian Schlichtherle <[email protected]>
  • Loading branch information
christian-schlichtherle authored and brian-brazil committed Dec 5, 2019
1 parent b61dd23 commit ef16c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ public <E> E time(Callable<E> timeable) {

try {
return timeable.call();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
Expand Down
2 changes: 2 additions & 0 deletions simpleclient/src/main/java/io/prometheus/client/Summary.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ public <E> E time(Callable<E> timeable) {

try {
return timeable.call();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
Expand Down

0 comments on commit ef16c43

Please sign in to comment.