All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RestException, VaultRestException

public abstract class ApiRestException extends ApiException
Exception when invoking remote REST API caused by wrong response from the API call. This exception means the API was invoked, we got a response back, but the status of the response was not valid for the invoked request. Each implementation is expected to extend this class and its builder to provide better details for the integrated system (such as system specific error messages).
See Also:
  • Constructor Details

    • ApiRestException

      protected ApiRestException(ApiRestException.BaseBuilder<?> builder)
      Create a new instance using base builder.
      Parameters:
      builder - builder
  • Method Details

    • status

      public Http.ResponseStatus status()
      Returned HTTP status.
      Returns:
      status
    • requestId

      public String requestId()
      Request ID used to invoke the request. This may have been generated by RestApi.
      Returns:
      request ID
    • apiSpecificError

      public Optional<String> apiSpecificError()
      API specific error message if such is available.
      Returns:
      api specific error, probably obtained from a header or entity
    • headers

      public Headers headers()
      Response HTTP headers.
      Returns:
      headers