ExceptionUtils.rethrow accepts Throwable

This commit is contained in:
Stepan Koltsov
2012-06-08 04:19:24 +04:00
parent 177b3eae5e
commit 6f78e9e99b
@@ -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);
}