Protocol specification
Errors and close codes
The registered protocol error codes, retriability, and websocket close codes.
Error objects
An err envelope and an s_err both carry an error object:
{ "code": "invalid_params", "message": "…", "retriable": false, "data": null }code is a string. retriable is explicit on every instance: a callee may mark a normally retriable
failure as permanent, or the reverse. data is optional structured detail.
Registered codes
| Code | Retriable by convention | Meaning |
|---|---|---|
parse_error | A frame or envelope could not be decoded. | |
unsupported_version | The peers share no protocol version. | |
unauthorized | The credential was not accepted. | |
forbidden_scope | The credential lacks the scope this call needs. | |
method_not_found | No such method or tool. | |
invalid_params | The arguments do not match the tool's schema or rules. | |
capability_not_announced | The peer has not announced this capability. | |
capability_rejected | An announced capability was refused, e.g. a reserved name. | |
capability_unavailable | The capability was withdrawn while the call was in flight. | |
node_offline | yes | The node the call is for is not reachable from here. |
connection_lost | yes | The connection dropped with the call in flight. |
stream_lagged | yes | A gap was detected in a stream's chunks. |
credit_violation | A stream sender exceeded its flow-control credit. | |
payload_too_large | A frame or value exceeded a declared limit. | |
overloaded | yes | Too many requests in flight. |
canceled | The call was cancelled. | |
timeout | yes | The call did not finish in time. |
internal | Something failed inside the callee. |
Capabilities may define additional codes. They MUST NOT collide with this registry.
Websocket close codes
| Code | Meaning |
|---|---|
1000 | Graceful close. |
4400 | Unsupported protocol version. |
4401 | Authentication failed, or the credential was revoked. |
4408 | Unknown frame kind, or a malformed frame. |
4409 | Flow-control violation. |