Class ApiClientServiceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.forgerock.openig.fapi.apiclient.service.ApiClientServiceException
- All Implemented Interfaces:
Serializable
Exception raised when failures occur using an
ApiClientService
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of possible error codes for the ApiClientServiceException. -
Constructor Summary
ConstructorsConstructorDescriptionApiClientServiceException
(ApiClientServiceException.ErrorCode errorCode, String message) Constructs a new ApiClientServiceException with the specified error code and message.ApiClientServiceException
(ApiClientServiceException.ErrorCode errorCode, String message, Throwable cause) Constructs a new ApiClientServiceException with the specified error code, message, and cause. -
Method Summary
Modifier and TypeMethodDescriptionBuild aResponse
from the current exception.Returns the error code associated with this exception.Returns the detail message string of this exception, including the error code.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ApiClientServiceException
Constructs a new ApiClientServiceException with the specified error code and message.- Parameters:
errorCode
- the error code representing the type of errormessage
- the detail message
-
ApiClientServiceException
public ApiClientServiceException(ApiClientServiceException.ErrorCode errorCode, String message, Throwable cause) Constructs a new ApiClientServiceException with the specified error code, message, and cause.- Parameters:
errorCode
- the error code representing the type of errormessage
- the detail messagecause
- the cause of the exception (a null value is permitted)
-
-
Method Details
-
getErrorCode
Returns the error code associated with this exception.- Returns:
- the error code
-
getMessage
Returns the detail message string of this exception, including the error code.- Overrides:
getMessage
in classThrowable
- Returns:
- the detail message string of this exception
-
asPromise
-
asResponse
Build aResponse
from the current exception.- Returns:
- the
Response
built
-