From 6f78e9e99b27d65af420c6662a9d07b6d4948129 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Fri, 8 Jun 2012 04:19:24 +0400 Subject: [PATCH] ExceptionUtils.rethrow accepts Throwable --- .../util/src/org/jetbrains/jet/utils/ExceptionUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/util/src/org/jetbrains/jet/utils/ExceptionUtils.java b/compiler/util/src/org/jetbrains/jet/utils/ExceptionUtils.java index e344140be6f..0ea161343e0 100644 --- a/compiler/util/src/org/jetbrains/jet/utils/ExceptionUtils.java +++ b/compiler/util/src/org/jetbrains/jet/utils/ExceptionUtils.java @@ -24,10 +24,13 @@ public class ExceptionUtils { /** * Translate exception to unchecked exception. */ - public static RuntimeException rethrow(Exception e) { + public static RuntimeException rethrow(Throwable e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } + else if (e instanceof Error) { + throw (Error) e; + } else { throw new RuntimeException(e); }