Expand description
Shared error-domain model and naming policy.
Every errors: domain declared anywhere in the API is flattened into a
single, de-duplicated list (all) so all backends surface the same
typed errors, and the idiomatic naming policy is centralized here so we
never again emit drift like KEY_NOT_FOUNDError (raw SCREAMING_SNAKE with a
naive Error suffix) in one language and keyNotFound in another.
Backends pick the brand/suffix that matches their ecosystem
(ERROR_BRAND for Swift/Python/TS/C++/Ruby/Go, EXCEPTION_BRAND for
Kotlin/.NET/Dart) and case-convert each code’s ResolvedError::raw_name
through the helpers below.
Structs§
- Resolved
Error - A single error code, flattened across the whole API.
Constants§
- BRAND_
STEM - Canonical brand stem. Always
WeaveFFI(uppercaseFFI) — never theheck-derivedWeaveffithat several generators used to emit. - ERROR_
BRAND - Base error type for ecosystems that use the
Errorsuffix (Swift, Python, TypeScript/Node, C++, Ruby, Go). - EXCEPTION_
BRAND - Base exception type for ecosystems that use the
Exceptionsuffix (Kotlin/Android, .NET, Dart).
Functions§
- all
- All error codes declared anywhere in the API, in module-declaration order
(depth-first), de-duplicated by
raw_name(first occurrence wins). Returns an empty vec when the API declares no error domains. - has_
domains - Whether the API declares any error domains at all.
- pascal
- PascalCase form of a raw error code name, with no suffix.
KEY_NOT_FOUND→KeyNotFound. Use for languages whose error variants are nested types/cases (Kotlin sealed subclasses, etc.) rather than standalone*Errorclasses. - type_
name - PascalCase + exactly one
suffix, avoiding doubled or SCREAMING suffixes.("KEY_NOT_FOUND", "Error")→KeyNotFoundError;("AlreadyError", "Error")→AlreadyError.