A2UI.Protocol.Messages.Error (A2UI v0.3.0)

Copy Markdown View Source

Represents an error message sent from client to server.

Used when the client detects a validation failure that the agent should be informed about, enabling a self-correction loop.

Fields

  • code — error code, e.g. "VALIDATION_FAILED"
  • surface_id — the surface where the error occurred
  • path — JSON Pointer to the problematic field
  • message — brief explanation of the failure

Summary

Functions

Parses a raw JSON map into an Error struct.

Converts an Error struct back to a JSON-compatible map.

Types

t()

@type t() :: %A2UI.Protocol.Messages.Error{
  code: String.t(),
  message: String.t(),
  path: String.t(),
  surface_id: String.t()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Parses a raw JSON map into an Error struct.

to_map(msg)

@spec to_map(t()) :: map()

Converts an Error struct back to a JSON-compatible map.