public class FailureException
extends java.lang.Exception
Failure objects.| Constructor and Description |
|---|
FailureException(Failure failure)
Build exception with failure.
|
FailureException(Failure failure,
java.lang.Throwable cause)
Build exception with failure and a cause.
|
FailureException(java.lang.String message)
Build exception with the passed message.
|
| Modifier and Type | Method and Description |
|---|---|
static FailureException |
create(java.lang.String errorCode,
java.lang.String errorMessage)
Factory method to wrap the passed error code and message into
a
Failure object enclosed by the exception. |
Failure |
getFailure() |
public FailureException(java.lang.String message)
Failure object will
set both its code and its message to the passed value.message - Exception messagepublic FailureException(Failure failure)
failure - Failure to wrappublic FailureException(Failure failure, java.lang.Throwable cause)
failure - Failure to wrapcause - Cause of the exceptionpublic Failure getFailure()
public static FailureException create(java.lang.String errorCode, java.lang.String errorMessage)
Failure object enclosed by the exception.
This method is useful to remove the need of instantiating
Failure objects outside this class.errorCode - Failure codeerrorMessage - Failure message