Error Handling
AIO Sandbox APIs expose several layers of errors. A robust client should not rely on HTTP status alone.
Recommended Order
- Check the HTTP status code.
- If the response is JSON, check
success. - For execution APIs, inspect domain fields such as
status,exit_code,stdout, andstderr. - For WebSocket and streaming APIs, handle connection close and partial output separately.
HTTP Errors
Common HTTP failures include:
Tool-Level Errors
Some APIs can return HTTP 200 while reporting a tool failure:
Treat success: false as a handled operation failure. Show message to the user or pass it back to your agent.
Execution Errors
Shell, Bash, Jupyter, Node.js, and unified code execution may return process-level details:
For these APIs, success: true only means the sandbox handled the request. The executed command or code can still fail.