org.apache.commons.inject.util
Class Exceptions
java.lang.Object
org.apache.commons.inject.util.Exceptions
public class Exceptions
- extends Object
A utility class for dealing with Exceptions.
|
Method Summary |
static RuntimeException |
show(Throwable pTh)
Throws the given exception, or another exception, which doesn't affect
the method signature. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Exceptions
public Exceptions()
show
public static RuntimeException show(Throwable pTh)
- Throws the given exception, or another exception, which doesn't affect
the method signature.
- Parameters:
pTh - The Throwable to show. If this is an instance of
RuntimeException, or Error, then this Throwable itself
will be thrown. Otherwise, the Throwable will be wrapped into an instance
of UndeclaredThrowableException, and that will be thrown.
- Returns:
- Nothing, an exception will always be thrown: This method is
effectively void. To declare it otherwise makes it possible to write
throw show(myThrowable);, which allows the compiler to detect
what's happening.
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.