A failed Sudski registar API interaction.
When the response carries the API's JSON error envelope the error_code,
error_message and log_id fields are populated (always quote log_id when
contacting upstream support). http_status is set whenever there was a
response; reason carries a transport/decoding failure when there was not.
Summary
Functions
Builds an error from a response status and body.
Types
Functions
@spec from_response(pos_integer(), term()) :: t()
Builds an error from a response status and body.
A map body, or a binary that parses as a JSON object, is read as an error
envelope: both the Sudreg shape (error_code/error_message/log_id, on
400/500) and the ORDS problem+json shape (code/message, on 401) are
recognised. Any other body (e.g. the ORDS HTML page) yields an error carrying
just the status.