Interface Errors


public interface Errors
Errors provides methods to create service errors
Since:
V5.13
  • Method Details

    • createRequestError

      HttpRequestError createRequestError​(java.lang.String error, int code)
      Creates a HttpRequestError supplying 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 Error
      code - response code from the RESTFul data connector call
      Returns:
      new RequestError instance
    • createAuthorisationError

      HttpAuthorisationError createAuthorisationError​(java.lang.String error, int code)
      Creates a HttpAuthorisationError supplying 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 Error
      code - response code from the RESTFul data connector call
      Returns:
      new AuthorisationError instance
    • createNotFoundError

      HttpNotFoundError createNotFoundError​(java.lang.String error, int code)
      Creates a HttpNotFoundError supplying 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 Error
      code - response code from the RESTFul data connector call
      Returns:
      new NotFoundError instance
    • createServerError

      HttpServerError createServerError​(java.lang.String error, int code)
      Creates a HttpServerError supplying 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 Error
      code - response code from the RESTFul data connector call
      Returns:
      new ServerError instance
    • createUnknownError

      HttpUnknownError createUnknownError​(java.lang.String error, int code)
      Creates a HttpUnknownError supplying 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 Error
      code - response code from the RESTFul data connector call
      Returns:
      new UnknownError instance