Package org.apache.juneau
Class BasicException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.juneau.BasicException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BeanRecursionException
Subclass of non-runtime exceptions that take in a message and zero or more arguments.
See Also:
-
Constructor Summary
ConstructorDescriptionBasicException
(String message, Object... args) Constructor.BasicException
(Throwable causedBy) Constructor.BasicException
(Throwable causedBy, String message, Object... args) Constructor. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BasicException
Constructor.- Parameters:
message
- TheMessageFormat
-style message.args
- OptionalMessageFormat
-style arguments.
-
BasicException
Constructor.- Parameters:
causedBy
- The cause of this exception.message
- TheMessageFormat
-style message.args
- OptionalMessageFormat
-style arguments.
-
BasicException
Constructor.- Parameters:
causedBy
- The cause of this exception.
-
-
Method Details
-
getCause
Same asThrowable.getCause()
but searches the throwable chain for an exception of the specified type.- Type Parameters:
T
- The throwable type to search for.- Parameters:
c
- The throwable type to search for.- Returns:
- The exception, or
null if not found.
-
unwrap
Returns the caused-by exception if there is one.- Returns:
- The caused-by exception if there is one, or this exception if there isn't.
-