Central error processing module for RPC operations.
Handles error transformation, unwrapping, and formatting for TypeScript clients. Uses the AshTypescript.Rpc.Error protocol to extract minimal information from exceptions.
Summary
Functions
Transforms errors into standardized RPC error responses.
Builds a generic client-facing error for a term no handler recognises.
Unwraps nested error structures from Ash error classes.
Functions
Transforms errors into standardized RPC error responses.
Processes errors through the following pipeline:
- Convert to Ash error class using Ash.Error.to_error_class
- Unwrap nested error structures
- Transform via Error protocol
- Apply resource-level error handler (if configured)
- Apply domain-level error handler (if configured)
- Interpolate variables into messages
Builds a generic client-facing error for a term no handler recognises.
The term is logged server-side under a fresh error id and the client only receives that id, so internal state never reaches the response.
Unwraps nested error structures from Ash error classes.