Skip to main content

Error Format

{
  "error": {
    "code": "error_code",
    "message": "Human-readable error message",
    "details": {}
  }
}

Common Error Codes

CodeStatusDescription
unauthorized401Invalid or missing API key
session_not_found404Session doesn’t exist or expired
rate_limit_exceeded429Too many requests
execution_timeout408Code execution timed out
memory_limit_exceeded507Memory limit exceeded
disk_full507Disk space limit exceeded
invalid_request400Invalid request parameters

Handling Errors

try {
  const result = await client.execute({ ... });
} catch (error) {
  if (error instanceof BuntimeError) {
    switch (error.code) {
      case 'session_not_found':
        // Handle expired session
        break;
      case 'rate_limit_exceeded':
        // Wait and retry
        await new Promise(r => setTimeout(r, error.retryAfter * 1000));
        break;
      default:
        console.error('Error:', error.message);
    }
  }
}