public class APIError extends Object
APIError class is the superclass for errors which can be occurred
on Virgil services call.| Constructor and Description |
|---|
APIError(int statusCode,
String errorBody)
Create a new instance
APIError. |
APIError(Throwable throwable)
Create a new instance of
APIError. |
| Modifier and Type | Method and Description |
|---|---|
int |
getErrorCode()
Returns the code of an error which occurred on Virgil service.
|
protected String |
getErrorPrefix()
Returns the prefix of error message which stored in
Messages.properties. |
String |
getMessage()
Returns the detail message string of this error.
|
int |
getStatusCode()
Returns the status code of response from Virgil service.
|
Throwable |
getThrowable()
Returns the cause of an error.
|
void |
setErrorCode(int errorCode)
Sets the code of an error which occurred on Virgil service.
|
void |
setStatusCode(int statusCode)
Sets the status code of response from Virgil service.
|
void |
setThrowable(Throwable throwable)
Sets the cause of an error.
|
String |
toString() |
public APIError(Throwable throwable)
APIError.throwable - the cause of an error.public APIError(int statusCode,
String errorBody)
APIError.statusCode - the status code of response from Virgil service.errorBody - the body of response from Virgil service. Virgil service
provides detailed description of error as JSON.public String getMessage()
APIError instance
(which may be null)protected String getErrorPrefix()
Messages.properties.public int getErrorCode()
public void setErrorCode(int errorCode)
errorCode - the code of an errorpublic int getStatusCode()
public void setStatusCode(int statusCode)
statusCode - the status code of response from Virgil service.public Throwable getThrowable()
null).public void setThrowable(Throwable throwable)
throwable - the cause of an error.Copyright © 2016. All rights reserved.