Package com.ebasetech.xi.services
Interface Errors
public interface Errors
Errors provides methods to create service errors- Since:
- V5.13
-
Method Summary
Modifier and Type Method Description HttpAuthorisationErrorcreateAuthorisationError(java.lang.String error, int code)Creates aHttpAuthorisationErrorsupplying an error message and the response code.HttpNotFoundErrorcreateNotFoundError(java.lang.String error, int code)Creates aHttpNotFoundErrorsupplying an error message and the response code.HttpRequestErrorcreateRequestError(java.lang.String error, int code)Creates aHttpRequestErrorsupplying an error message and the response code.HttpServerErrorcreateServerError(java.lang.String error, int code)Creates aHttpServerErrorsupplying an error message and the response code.HttpUnknownErrorcreateUnknownError(java.lang.String error, int code)Creates aHttpUnknownErrorsupplying an error message and the response code.
-
Method Details
-
createRequestError
Creates aHttpRequestErrorsupplying an error message and the response code. This is typically used to create HTTP response failure errors, for example the server responds with a 400 Bad Request code- Parameters:
error- message for the Request Errorcode- response code from the RESTFul data connector call- Returns:
- new RequestError instance
-
createAuthorisationError
Creates aHttpAuthorisationErrorsupplying an error message and the response code. This should be used when generating Authentication errors, for example the server responds with a 401 Unauthorized code- Parameters:
error- message for the Authorisation Errorcode- response code from the RESTFul data connector call- Returns:
- new AuthorisationError instance
-
createNotFoundError
Creates aHttpNotFoundErrorsupplying an error message and the response code. This should be used when generating not found errors, for example the server responds with a 404 Not Found code- Parameters:
error- message for the Not Found Errorcode- response code from the RESTFul data connector call- Returns:
- new NotFoundError instance
-
createServerError
Creates aHttpServerErrorsupplying an error message and the response code. This should be used when generating generic server errors, for example the server responds with a 500 Server Error code- Parameters:
error- message for the Server Errorcode- response code from the RESTFul data connector call- Returns:
- new ServerError instance
-
createUnknownError
Creates aHttpUnknownErrorsupplying an error message and the response code. This should be used when generating an Unknown Error, for example the HTTP code is not recognized- Parameters:
error- message for the Server Errorcode- response code from the RESTFul data connector call- Returns:
- new UnknownError instance
-