The single error struct used across the A2UI packages.
Categories classify errors for conformance matching and are drawn from the reference implementation's exception classes:
| Category | Reference class |
|---|---|
:parse | A2uiParseError |
:validation | A2uiValidationError |
:catalog | A2uiCatalogError |
:state | A2uiStateError |
:integrity | A2uiIntegrityError |
:recursion | A2uiRecursionError |
:data | A2uiDataError |
:expression | A2uiExpressionError |
:rpc | A2uiRpcError |
:compilation | A2uiCompilationError (agent side) |
A2UICore.Error is usable both as a raised exception and inside
{:error, error} tuples; both forms are equivalent and the harness
decides which shape is used at the call site.
Summary
Functions
Builds a new A2UICore.Error with the given category and code.
Convenience raise helper — equivalent to
raise A2UICore.Error, category:..., code:..., message:....
Types
@type category() ::
:parse
| :validation
| :catalog
| :state
| :integrity
| :recursion
| :data
| :expression
| :rpc
| :compilation
Functions
Builds a new A2UICore.Error with the given category and code.
Options
:path— JSON pointer of the offending field.:surface_id— the surface the error pertains to.:function_call_id— relevant for v1.0 RPC failures.:details— list ofA2UICore.Error.Detail.t/0.
Examples
iex> err = A2UICore.Error.new(:validation, "VALIDATION_FAILED", "bad")
iex> {err.category, err.code}
{:validation, "VALIDATION_FAILED"}
Convenience raise helper — equivalent to
raise A2UICore.Error, category:..., code:..., message:....