JSON-RPC 2.0 error object, plus the ACP-specific vendor error codes.
Standard JSON-RPC 2.0 codes:
-32700— parse error (malformed JSON)-32600— invalid request (well-formed JSON, not a valid Request object)-32601— method not found-32602— invalid params-32603— internal error
ACP-specific codes:
-32000— authentication required-32002— resource not found
Decoding is total: from_json/1 never raises. Unknown fields on the wire
object are preserved in _meta and re-emitted on encode (forward-compat
pass-through), never rejected as an error.
Ported from the MIT f1729/agent_client_protocol (c) 2025 f1729; see NOTICE.md.
Summary
Functions
Convert an ErrorCode integer to its name atom, or {:other, code} when unrecognized.
Decode a JSON-RPC error object. Total: malformed or wrong-shaped input
returns {:error, :invalid_error} rather than raising.
Types
Functions
@spec auth_required() :: t()
@spec auth_required_code() :: integer()
Convert an ErrorCode integer to its name atom, or {:other, code} when unrecognized.
Decode a JSON-RPC error object. Total: malformed or wrong-shaped input
returns {:error, :invalid_error} rather than raising.
@spec internal_error() :: t()
@spec internal_error_code() :: integer()
@spec invalid_params() :: t()
@spec invalid_params_code() :: integer()
@spec invalid_request() :: t()
@spec invalid_request_code() :: integer()
@spec method_not_found() :: t()
@spec method_not_found_code() :: integer()
@spec parse_error() :: t()
@spec parse_error_code() :: integer()
@spec resource_not_found_code() :: integer()