Central error processing module for RPC operations.
Handles error transformation, unwrapping, and formatting for clients. Uses the AshIntrospection.Rpc.Error protocol to extract minimal information from exceptions.
This is a shared module used by both AshTypescript and AshKotlinMultiplatform. Language-specific behavior is configured via the config parameter.
Summary
Functions
Transforms errors into standardized RPC error responses.
Unwraps nested error structures from Ash error classes.
Types
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
Parameters
errors- The error(s) to transformdomain- The domain module (optional)resource- The resource module (optional)action- The action name (optional)context- Additional context mapconfig- Language-specific configuration (see type definition)
Unwraps nested error structures from Ash error classes.