Skip to main content

Module errors

Module errors 

Source
Expand description

The single HTTP error model: ApiError with its ErrorCode status class, plus ValidationError field detail.

An ApiError carries a stable machine code, a public message and, optionally, the internal cause as a source that is logged and never serialised. The wire shape enforces the redaction rule itself: a 5xx serialises the fixed public message of its code with no details or validation errors, whatever text the error was built with, so internal error text cannot reach a response body. Repository errors convert through the one canonical From<RepositoryError> mapping in the repository module; an identifier that fails to parse converts through From<IdValidationError> (400) in the identifier module.

Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.

Structs§

ApiError
The HTTP error envelope every non-protocol route answers with.
ValidationError

Enums§

ErrorCode