curl -s 'https://www.unum.cloud/docs/ucall/cpp/errors.md' | claude -p "How would this fit my code?"
Every fallible verb answers a status_t, or an expected<T>, a plain pair of a value and its status_t unpacked as auto [value, status], whose value is default-constructed on failure.
A status_t carries a status_code_t and an optional static note beside it, so nothing allocates on the failure path, and status == status_code_t::timeout_k compares the code.
Recovery branches on the code, while the note names the broken step or resource for logs, falling back to the status name.
A mistake the binding catches before calling the library, like asking for an interface the server lacks, reports the status the library would have used.
A submitted call that fails completes with a failed completed_t::response: connection_failed_k, connection_closed_k, timeout_k, handshake_failed_k or peer_rejected_k.
HTTP error statuses are ordinary responses. status_name, io_backend_name and cpu_class_name spell stable names, like “linux-uring618” and “intel-icelake”, and their _from_name twins parse them back, failing with status_code_t::invalid_argument_k on a name no value has. version_name() spells the linked library’s version, candidate suffix included, and decode_percent decodes a path or a query value, which requests hold still percent-encoded.
API
Types
status_code_tWhat went wrong, with one enumerator per status the library reports.
status_tWhy a call failed: a code recovery branches on, and an optional static note naming the broken invariant, step or resource, for logs and regression analysis.