Stable public error envelope for all non-bang and bang APIs.
Rulestead returns this struct in {:error, error} tuples and raises the same
struct from bang variants. Typed helper modules such as Rulestead.StoreError
construct this envelope instead of introducing competing public error structs.
Summary
Types
Top-level error family used to group stable leaf error types.
Closed Phase 2 leaf error atoms.
Functions
Returns the stable top-level error domains.
Returns the closed Phase 2 leaf error atoms.
Builds a new normalized error struct.
Normalizes a term into a Rulestead.Error.
Types
@type detail() :: %{optional(detail_key()) => detail_value()}
@type domain() :: :evaluation | :ruleset | :kill_switch | :config | :store | :auth
Top-level error family used to group stable leaf error types.
@type metadata() :: %{optional(metadata_key()) => metadata_scalar()}
@type type() ::
:flag_not_found
| :environment_not_found
| :snapshot_not_found
| :ruleset_not_found
| :missing_targeting_key
| :repo_not_configured
| :repo_ambiguous
| :store_not_configured
| :store_adapter_invalid
| :store_unavailable
| :invalid_command
| :invalid_ruleset
| :variant_weights_invalid
| :invalid_value_projection
| :malformed_runtime_data
| :flag_archived
| :unauthorized
| :kill_switch_active
| :not_implemented
Closed Phase 2 leaf error atoms.
Downstream phases should extend this list deliberately when they add new public
failure modes rather than returning broad atoms such as :invalid or :not_found.