Package com.faircom.jsonaction
Class ApiException
- Object
-
- Throwable
-
- Exception
-
- ApiException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConnectionException
public class ApiException extends Exception
Base class for all FairCom JSON Action exceptions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApiException(String message)
Constructs a new exception with the specified detail message.ApiException(String message, int errorCode)
Constructs a new exception with the specified detail message and errorCode.ApiException(String message, int errorCode, ObjectNode response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getErrorCode()
Return the errorCode associated with this exception.String
getMessage()
Return the errorMessage associated with this exception.ObjectNode
getResponse()
Return the response associated with this exception.
-
-
-
Constructor Detail
-
ApiException
public ApiException(String message)
Constructs a new exception with the specified detail message.- Parameters:
message
- the detail message. The detail message is saved for later retrieval by the java.lang.Throwable.getMessage() method.- Since:
- 1.0
-
ApiException
public ApiException(String message, int errorCode)
Constructs a new exception with the specified detail message and errorCode.- Parameters:
message
- the detail message. The detail message is saved for later retrieval by the java.lang.Throwable.getMessage() method.errorCode
- the errorCode returned from the FairCom JSON Action API.- Since:
- 1.0
-
ApiException
public ApiException(String message, int errorCode, ObjectNode response)
- Parameters:
message
- the detail message. The detail message is saved for later retrieval by the java.lang.Throwable.getMessage() method.errorCode
- the errorCode returned from the FairCom JSON Action API.response
- the JSON Action response which triggered this exception.- Since:
- 1.0
-
-
Method Detail
-
getMessage
public String getMessage()
Return the errorMessage associated with this exception.- Overrides:
getMessage
in classThrowable
- Returns:
- the message associated with this exception.
- Since:
- 1.0
-
getErrorCode
public Integer getErrorCode()
Return the errorCode associated with this exception.- Returns:
- the errorCode associated with this exception
- Since:
- 1.0
-
getResponse
public ObjectNode getResponse()
Return the response associated with this exception.- Returns:
- the response associated with this exception.
- Since:
- 1.0
-
-