Protocol for rendering Ash errors into the Lua-side error shape.
Each to_error/1 impl returns a map with these keys (all strings on the Lua side):
:message— the human-readable message to surface:short_message— a terse variant suitable for tooltips/logs:code— a stable, machine-readable identifier (e.g."invalid_argument","required","not_found"):fields— list of atom field names this error relates to (may be empty):vars— additional template/context variables interpolatable intomessage
Errors without an impl fall through to an opaque "unknown error" entry in the encoder.
Summary
Types
@type t() :: term()
All the types that implement this protocol.