Skip to main content

Error Codes

ARC Protocol error codes and handling.

Standard RPC Errors

Borrowed from JSON-RPC convention:

CodeMessageDescription
-32600Invalid RequestMalformed request
-32601Method not foundUnknown method
-32602Invalid paramsInvalid parameters
-32603Internal errorServer error

ARC-Specific Errors

CodeMessageDescription
-42001Agent not foundTarget agent unavailable
-42002Authentication failedInvalid credentials
-42003Task not foundTask ID not found
-42004Task processing errorTask execution failed
-42005Chat not foundChat ID not found
-42006Invalid agent stateAgent in invalid state
-42007Rate limit exceededToo many requests
-42008Insufficient scopeMissing required OAuth scope

Error Response

{
"error": {
"code": -42001,
"message": "Agent not found",
"data": {
"targetAgent": "nonexistent-agent",
"availableAgents": ["agent-1", "agent-2"]
}
}
}

Error Handling

Client-Side

from arc import Client
from arc.exceptions import ARCException

client = Client("https://api.example.com/arc")

try:
response = await client.chat.start(...)
except ARCException as e:
if e.code == -42001:
print("Agent not found")
elif e.code == -42002:
print("Authentication failed")
else:
print(f"Error: {e.message}")

Server-Side

from arc import Server
from arc.exceptions import ARCException

server = Server(server_id="my-server")

@server.agent_handler("my-agent", "chat.start")
async def handle_start(params, context):
if not is_valid_request(params):
raise ARCException(code=-32602, message="Invalid params")

# Process request
return {...}

Full Specification

See complete error handling: ARC Specification Document