ExceptionUtils.rethrow accepts Throwable
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user