Skip to main content

Module error

Module error 

Source
Expand description

The one error type every call answers with, its categories and their exit codes.

Structs§

Error
The error every SDK call can answer with.

Enums§

ErrorCode
Machine-readable error categories, shared with the other Fizzy SDKs.
Refusal
A call the SDK turned away itself, before anything was sent. It shares ErrorCode::ApiError or ErrorCode::RateLimit with the server’s own refusals and is told apart by carrying no HTTP status and one of these.

Constants§

EXIT_AMBIGUOUS
A name matched more than one record.
EXIT_API
The server returned an error.
EXIT_AUTH
Not authenticated.
EXIT_FORBIDDEN
Access denied.
EXIT_NETWORK
Connection, DNS or timeout failure.
EXIT_NOT_FOUND
Resource not found.
EXIT_OK
The call succeeded.
EXIT_RATE_LIMIT
Rate limited (429).
EXIT_USAGE
Invalid arguments or flags.
EXIT_VALIDATION
The server rejected the contents of the request (422).
MAX_ERROR_BODY_BYTES
The most of a failure’s body an error keeps, mirroring Go’s MaxErrorBodyBytes. A body past it is kept up to the bound and no further: an error is diagnostic, and a server answering a refusal with a megabyte of anything has said everything useful long before.
MAX_ERROR_MESSAGE_BYTES
The most of a server’s own message an error’s hint carries, mirroring Go’s MaxErrorMessageBytes. A longer one is cut and ends in ....