public final class Exceptions
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.RuntimeException |
propagate(java.lang.Throwable t)
Convenience method to throw a
RuntimeException and Error directly
or wrap any other exception type into a RuntimeException . |
static void |
throwIfFatal(java.lang.Throwable t)
Throws a particular
Throwable only if it belongs to a set of "fatal" error varieties. |
public static java.lang.RuntimeException propagate(java.lang.Throwable t)
RuntimeException
and Error
directly
or wrap any other exception type into a RuntimeException
.t
- the exception to throw directly or wrappedpropagate
itself throws an exception or error, this is a sort of phantom return
value; propagate
does not actually return anythingpublic static void throwIfFatal(java.lang.Throwable t)
Throwable
only if it belongs to a set of "fatal" error varieties. These
varieties are as follows:
VirtualMachineError
ThreadDeath
LinkageError
onError
methods, but only
if the errors are not so catastrophic that such a call would be futile, in which case you simply want to
rethrow the error.t
- the Throwable
to test and perhaps throw