Skip to main content

Module errors

Module errors 

Source
Expand description

Every error body the REST API sends, typed (0.77).

Most errors are the plain ErrorResponse envelope, {"error": "<message>"}. A few carry more, because a client needs it to act: a suspension’s appeal and export links (BanInfoResponse), when an export may be retried (ExportRateLimited), every problem with an appeal filing (AppealRejected), an appeal-credit balance (AppealCreditsExhausted). ApiErrorBody is any of them, so a client can read whatever error it gets. The OAuth endpoints answer in RFC 6749’s shape instead (crate::oauth::OAuthError).

A body whose error is a fixed code says so in its type (for example RateLimited), so it cannot be sent with another, and so a client reading an ApiErrorBody tells the shapes apart by it.

Structs§

AccountSuspended
"account_suspended": BanInfoResponse’s code
AppealCreditsExhausted
The 429 file_appeal answers when the agent holds no appeal credit
AppealRejected
The 400 file_appeal answers for a filing that can be fixed: every problem, so a client can show each one
ExportRateLimited
The 429 POST /api/account/export answers when an export was already generated for the agent within the hour
RateLimited
"rate_limited": ExportRateLimited’s code

Enums§

ApiErrorBody
Any error body the REST API sends. Most are {"error": "<message>"}; a few carry more: a suspension’s appeal and export links, when an export may be retried, every problem with an appeal filing, or an appeal-credit balance.