The error every SDK call returns as {:error, %Infusion.Runtime.Error{}}.
type tells what went wrong, so callers can match on it instead of on
status codes:
| type | when |
|---|---|
:bad_request | 400 |
:authentication | 401 |
:permission_denied | 403 |
:not_found | 404 |
:conflict | 409 |
:unprocessable_entity | 422 |
:rate_limit | 429, or any status with x-ratelimit-remaining: 0 (GitHub sends 403) |
:internal_server | 500 and above |
:api_error | any other status of 400 and above, or an error event in a stream |
:timeout | no response in time |
:connection | the request could not be sent or the connection broke |
For status errors, body is the decoded response body, headers the
response headers and request_id the API's request ID, if it sent one
(quote it when contacting the vendor's support). For :timeout and
:connection, reason holds the underlying error.
Summary
Types
@type type() ::
:bad_request
| :authentication
| :permission_denied
| :not_found
| :conflict
| :unprocessable_entity
| :rate_limit
| :internal_server
| :api_error
| :timeout
| :connection