com.holonplatform.http

## Interface ErrorResponse

- All Known Subinterfaces:
    AuthenticationError
  All Known Implementing Classes:
    AuthenticationException, AuthorizationException, DisabledAccountException, ErrorResponse.ErrorResponseException, ExpiredCredentialsException, InvalidCredentialsException, InvalidTokenException, LockedAccountException, UnexpectedAuthenticationException, UnknownAccountException, UnsupportedMessageException, UnsupportedPermissionException, UnsupportedTokenException

      public interface ErrorResponse

  A generic error response representation, providing conventional error informations including an error code, an optional description and URI for more details, and the HTTP status code.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `ErrorResponse.ErrorResponseException` Base class to build a `RuntimeException` with `ErrorResponse` support.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ERROR_CODE_SERIALIZATION_NAME` Default serialization name for error code
    `static String` | `ERROR_DESCRIPTION_SERIALIZATION_NAME` Default serialization name for error description
    `static String` | `ERROR_URI_SERIALIZATION_NAME` Default serialization name for error URI
    `static String` | `INVALID_CLIENT` Default `invalid_client` error code: Client authentication failed (e.g.
    `static String` | `INVALID_REQUEST` Default `invalid_request` error code: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.
    `static String` | `INVALID_TOKEN` Default `invalid_token` error code: The provided authorization token is not valid (expired, revoked, malformed, or invalid for other reasons)
    `static String` | `SERVER_ERROR` Default `server_error` error code: Server encountered an unexpected condition that prevented it from fulfilling the request.
    `static String` | `TEMPORARY_UNAVAILABLE` Default `temporarily_unavailable` error code: Server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getErrorCode()` Error code.
    `String` | `getErrorDescription()` Error description, i.e.
    `String` | `getErrorURI()` Optional error URI that leads to further details about this error
    `int` | `getHttpStatus()` Optional HTTP status code to represent error as a HTTP response

- - ### Field Detail

    - #### SERVER_ERROR

          static final String SERVER_ERROR

      Default `server_error` error code: Server encountered an unexpected condition that prevented it from fulfilling the request.
      See Also:
        Constant Field Values

    - #### TEMPORARY_UNAVAILABLE

          static final String TEMPORARY_UNAVAILABLE

      Default `temporarily_unavailable` error code: Server is currently unable to handle the request due to a temporary overloading or maintenance of the server.
      See Also:
        Constant Field Values

    - #### INVALID_REQUEST

          static final String INVALID_REQUEST

      Default `invalid_request` error code: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.
      See Also:
        Constant Field Values

    - #### INVALID_CLIENT

          static final String INVALID_CLIENT

      Default `invalid_client` error code: Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method).
      See Also:
        Constant Field Values

    - #### INVALID_TOKEN

          static final String INVALID_TOKEN

      Default `invalid_token` error code: The provided authorization token is not valid (expired, revoked, malformed, or invalid for other reasons)
      See Also:
        Constant Field Values

    - #### ERROR_CODE_SERIALIZATION_NAME

          static final String ERROR_CODE_SERIALIZATION_NAME

      Default serialization name for error code
      See Also:
        Constant Field Values

    - #### ERROR_DESCRIPTION_SERIALIZATION_NAME

          static final String ERROR_DESCRIPTION_SERIALIZATION_NAME

      Default serialization name for error description
      See Also:
        Constant Field Values

    - #### ERROR_URI_SERIALIZATION_NAME

          static final String ERROR_URI_SERIALIZATION_NAME

      Default serialization name for error URI
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getErrorCode

          String getErrorCode()

      Error code.
      Returns:
        Error code

    - #### getErrorDescription

          String getErrorDescription()

      Error description, i.e. a human-readable explanation of this error
      Returns:
        Error description

    - #### getErrorURI

          String getErrorURI()

      Optional error URI that leads to further details about this error
      Returns:
        Error URI

    - #### getHttpStatus

          int getHttpStatus()

      Optional HTTP status code to represent error as a HTTP response
      Returns:
        HTTP status code, `-1` means unknown

Copyright © 2019 The Holon Platform. All rights reserved.