Class WrappedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.github.nullterminated.trylambda.WrappedException
- All Implemented Interfaces:
Serializable
A simple unchecked exception wrapper for wrapping checked
Exception types. Throwable types are not handled
since Throwable includes system errors like OutOfMemoryError.- Author:
- Ramsey Gurley
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetCause()Overridden to return Exception types instead of Throwable.static WrappedExceptionFactory method to generate a WrappedException.static WrappedExceptionFactory method to generate a WrappedException.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
getCause
Overridden to return Exception types instead of Throwable. -
wrap
Factory method to generate a WrappedException. If the Exception argument is itself a WrappedException, the cause of that argument is rewrapped with the new message argument.- Parameters:
message- the exception messagee- the original exception- Returns:
- a new WrappedException
-
wrap
Factory method to generate a WrappedException. If the Exception argument is itself a WrappedException, the cause of that argument is rewrapped.- Parameters:
e- the original exception- Returns:
- a new WrappedException
-