com.sun.sgs.impl.sharedutil
Class Exceptions
java.lang.Object
com.sun.sgs.impl.sharedutil.Exceptions
public final class Exceptions
- extends Object
Utility methods for working with Exceptions.
|
Method Summary |
static
|
initCause(T exception,
Throwable cause)
Returns the given exception with its cause initialized. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
initCause
public static <T extends Throwable> T initCause(T exception,
Throwable cause)
- Returns the given exception with its cause initialized. The
original exception is returned in a typesafe way so that it
can be thrown easily.
- Type Parameters:
T - the type of the parent exception- Parameters:
exception - the exception to initializecause - the cause
- Returns:
- the exception with its cause initialized
- Throws:
IllegalArgumentException - if an attempt is made to set
an exception as its own cause
IllegalStateException - if the exception has already had
its cause initialized- See Also:
Throwable.initCause(Throwable)
Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved