Splode error hierarchy for ash_hooks.
Inbound authentication and configuration failures have class :invalid.
Custody availability failures have class :unknown. Unrecognized reasons
become contents-free UnknownError values.
Summary
Functions
Maps a provider callback's reason (the {:error, reason} shape the
behavior returns) to its Splode error. Known provider atoms pass opts
through to exception/1; classified package errors pass through unchanged.
Calls the function for each leaf error and returns a nested map grouped
by error path. See Splode.traverse_errors/2 for the traversal contract.
Returns the value from {:ok, value} or :ok. Raises a converted error for
{:error, error} or :error, and ArgumentError for other result shapes.
Types
@type class() :: %{ :__struct__ => class_module(), :__exception__ => true, :errors => [t()], :class => error_class(), :bread_crumbs => [String.t()], :vars => Keyword.t(), :stacktrace => Splode.Stacktrace.t() | nil, :context => map(), optional(atom()) => any() }
@type class_module() :: AshHooks.Errors.Unknown | AshHooks.Errors.Invalid
@type error_class() :: :unknown | :invalid
@type t() :: %{ :__struct__ => module(), :__exception__ => true, :class => error_class(), :bread_crumbs => [String.t()], :vars => Keyword.t(), :stacktrace => Splode.Stacktrace.t() | nil, :context => map(), optional(atom()) => any() }
Functions
Maps a provider callback's reason (the {:error, reason} shape the
behavior returns) to its Splode error. Known provider atoms pass opts
through to exception/1; classified package errors pass through unchanged.
Unmapped reasons become a contents-free UnknownError; backend terms are
never included in that error.
Calls the function for each leaf error and returns a nested map grouped
by error path. See Splode.traverse_errors/2 for the traversal contract.
Returns the value from {:ok, value} or :ok. Raises a converted error for
{:error, error} or :error, and ArgumentError for other result shapes.
Accepts :error_opts for error conversion and :unknown_error_opts when
the result is :error. See Splode for the error-conversion contract.