Represents an API Error.
Summary
Functions
Builds an error from a response structure based on the HTTP status code.
Builds a validation error from a response structure.
Types
@type error_type() ::
:bad_request
| :unauthorized
| :forbidden
| :not_found
| :method_not_allowed
| :unprocessable_entity
| :too_many_requests
| :server_error
| :api_csrf_invalid
| :api_unexpected_response
| :api_unexpected_payload
| :api_unexpected_client_error
@type t() :: %DSpace.API.Error{ __exception__: term(), message: binary(), request_url: URI.t(), response: DSpace.API.HTTP.Response.t(), status: non_neg_integer(), type: error_type() }
Functions
@spec from_response(DSpace.API.HTTP.Response.t()) :: t()
Builds an error from a response structure based on the HTTP status code.
@spec response_validation_error(DSpace.API.HTTP.Response.t(), binary()) :: t()
Builds a validation error from a response structure.