Class WrappedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.github.nullterminated.trylambda.WrappedException
-
- All Implemented Interfaces:
java.io.Serializable
public final class WrappedException extends java.lang.RuntimeExceptionA simple unchecked exception wrapper for wrapping checkedExceptiontypes. Throwable types are not handled since Throwable includes system errors likeOutOfMemoryError.- Author:
- Ramsey Gurley
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ExceptiongetCause()Overridden to return Exception types instead of Throwable.static WrappedExceptionwrap(java.lang.Exception e)Factory method to generate a WrappedException.static WrappedExceptionwrap(java.lang.String message, java.lang.Exception e)Factory method to generate a WrappedException.
-
-
-
Method Detail
-
getCause
public java.lang.Exception getCause()
Overridden to return Exception types instead of Throwable.- Overrides:
getCausein classjava.lang.Throwable- Returns:
- an Exception
-
wrap
public static WrappedException wrap(java.lang.String message, java.lang.Exception e)
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
public static WrappedException wrap(java.lang.Exception e)
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
-
-