1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-26 01:38:57 -05:00
filebot/source/net/sourceforge/tuned/ExceptionUtil.java
Reinhard Pointner 21b5dc3fab * added FunctionIterator
* added Preferences Wrapper (Map, List)
2008-06-09 18:36:05 +00:00

25 lines
382 B
Java

package net.sourceforge.tuned;
public class ExceptionUtil {
public static Throwable getRootCause(Throwable t) {
while (t.getCause() != null) {
t = t.getCause();
}
return t;
}
public static RuntimeException asRuntimeException(Throwable t) {
if (t instanceof RuntimeException) {
return (RuntimeException) t;
}
return new RuntimeException(t);
}
}