curl -s 'https://www.unum.cloud/docs/uform/cpp/errors.md' | claude -p "How would this fit my code?"
Every fallible call answers a status_t alone, or an expected<T>, a plain pair 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, so nothing allocates on the failure path.
Recovery branches on the code, while the note names the broken invariant, step or resource for logs, falling back to the status name.
A failure the SDK catches before the call crosses the boundary reports the status the library would have used.
auto [encoded, status] = model.on(executor).text_encode(texts, uf::encode_outputs_t::embeddings_k, uform_scalar_f32_k, arena);if (status == uf::status_code_t::contended_k) retry();else if (status.failed()) fmt::println(stderr, "{}", status.note);else fmt::println("{} items", encoded.embeddings.written);
status_code_t carries the C enumerators’ values, and status_code_t::deferred_k reaches only deferred::status.
The C name tables, such as uform_status_name and uform_scalar_from_name, are called directly, since every SDK header includes its C header.
A handler is a noexcept callable, so no fault unwinds through the library.
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.