Skip to main content

Module errors

Module errors 

Source
Expand description

CleanLibraryError hierarchy per Client spec rev1 §2.3 + Rev 2 amendment §2. Mirrors App Rev 4 §9.2 reason-code enum surfaced via X-CleanLibrary-Reason response header.

Structs§

ProblemDetails
CLEANLIB-536: RFC 9457 application/problem+json problem document (reader side). Mirrors cleanlib-app::problem::ProblemDetails as a TOLERANT reader — every field is defaulted and unknown members are ignored (no deny_unknown_fields), so a new App extension never breaks parsing. Standard RFC 9457 members (type/title/status/detail/instance) plus the CLEANLIB-536 extensions.

Enums§

CleanLibraryError
Top-level error type for cleanlib-client operations. Mirrors Rev 1 §2.3 mapping table.
TransportError

Functions§

from_http
Map HTTP status + headers + body into a CleanLibraryError variant. Reads X-CleanLibrary-Reason header per App Rev 4 §9.2 reason codes.
parse_problem_details
Parse an application/problem+json body (CLEANLIB-536) into ProblemDetails, returning None when the body is absent or is not a problem document. A body is treated as a problem document when the response Content-Type is application/problem+json OR (defensively, in case a proxy strips the content-type) the parsed type URI is under the canonical https://cleanlibrary.dev/problems/ base. A bare JSON error body that merely happens to carry a type field is NOT misclassified.