Expand description
The shared error naming policy.
The error model (which domains exist, which codes they carry, which
module owns them) lives in the model as
ErrorBinding. This module holds only the
idiomatic naming rules every backend applies to those names, centralized so
no target drifts into KEY_NOT_FOUNDError (raw SCREAMING_SNAKE with a
naive Error suffix) while another emits keyNotFound.
Backends pick the suffix that matches their ecosystem (Error or
Exception) and case-convert each code’s name through the helpers below.
Functions§
- exception_
type_ name - Exception-branded type name for an error domain, for targets whose
idiomatic errors are exceptions rather than
*Errortypes. A trailingErrorstem is replaced instead of stacked:KvError->KvException;Failure->FailureException; a bareError->Exception. - 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.