#[non_exhaustive]pub enum ErrorCode {
BadRequest,
Unauthorized,
PayloadTooLarge,
UnsupportedTarget,
RenderFailed,
Internal,
Overloaded,
Unknown,
}Expand description
Machine-readable failure classification. Non-exhaustive: a newer server
may add codes (an unknown one decodes as ErrorCode::Unknown), so a
match needs a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadRequest
The body did not parse, or a field is out of range.
No bearer token, a malformed Authorization header, or the wrong
token. Distinct from ErrorCode::BadRequest because the client’s
remedy is to fix its credentials, not its payload.
PayloadTooLarge
The request body is larger than the server accepts. Distinct from
ErrorCode::BadRequest because retrying the identical request is
hopeless — the client has to split or shrink the upload.
UnsupportedTarget
The server was built without the feature this target/format needs
(e.g. html without typst-html), or lacks the pandoc binary.
RenderFailed
The pipeline ran and failed — bad markdown, a template that does not compile, an engine error.
Internal
Anything the server cannot attribute to the request.
Overloaded
Every render slot stayed busy for the server’s whole queue wait
(503, with Retry-After). Nothing is wrong with the request; send
it again later.
Unknown
A code this version of the protocol does not know — what a newer server’s addition decodes to, instead of failing the whole body.