Base Exception
HopxError
Base exception for all Hopx SDK errors.
message(str): Error messagecode(str, optional): Error coderequest_id(str, optional): Request ID for debuggingstatus_code(int, optional): HTTP status codedetails(dict, optional): Additional error details
API Errors
APIError
Base class for API-related errors.
AuthenticationError
Authentication failed (401).
NotFoundError
Resource not found (404).
ValidationError
Request validation failed (400).
RateLimitError
Rate limit exceeded (429).
ResourceLimitError
Resource limit exceeded.
ServerError
Server error (5xx).
Network Errors
NetworkError
Network communication failed.
TimeoutError
Request timed out.
Agent Operation Errors
AgentError
Base error for agent operations.
FileNotFoundError
File or directory not found in sandbox.
FileOperationError
File operation failed.
CodeExecutionError
Code execution failed.
CommandExecutionError
Command execution failed.
DesktopNotAvailableError
Desktop automation not available in this sandbox.
Error Handling Best Practices
1. Catch Specific Exceptions
2. Check Error Properties
3. Handle Rate Limits
4. Log Request IDs
Error Code Reference
Common error codes:file_not_found: File doesn’t existfile_operation_failed: File operation errorcode_execution_failed: Code execution errorcommand_execution_failed: Command execution errordesktop_not_available: Desktop features not availablevalidation_error: Request validation failedauthentication_error: Authentication failedrate_limit_exceeded: Rate limit exceededresource_limit_exceeded: Resource limit exceeded
Related
- Sandbox Class - Main sandbox class
- Code Execution - Code execution errors
- File Operations - File operation errors

