Import
Exception Hierarchy
Base Exception
MobileUseError
Base exception for all SDK errors.Agent Exceptions
AgentError
Base exception for agent-related errors.AgentNotInitializedError
Raised when agent methods are called before initialization. Common cause: Callingrun_task() before init()
AgentProfileNotFoundError
Raised when a specified profile is not found. Common cause: Using a profile name that hasn’t been registeredAgentTaskRequestError
Raised for task request validation errors. Common causes:- Invalid task configuration
- Conflicting parameters
AgentInvalidApiKeyError
Raised when the Minitap API key is invalid or unauthorized. Common causes:- Incorrect API key
- Expired API key
- API key not set
Device Exceptions
DeviceError
Base exception for device-related errors.DeviceNotFoundError
Raised when no device is found or device becomes disconnected. Common causes:- No device connected
- USB debugging not enabled
- Device unplugged during operation
- Check device connection:
- Enable USB debugging (Android)
- Specify device explicitly:
Server Exceptions
ServerError
Base exception for server-related errors.ServerStartupError
Raised when server startup fails. Common causes:- Port already in use
- Missing dependencies (Maestro)
- Permission issues
- Kill zombie servers:
- Check if Maestro is installed:
- Use custom ports:
Executable Exceptions
ExecutableNotFoundError
Raised when required system executables are not found in PATH. Common causes:adbnot installed (for Android)maestronot installedxcrunnot installed (for iOS on macOS)
- Install ADB (for Android):
- Install Maestro:
- Install Xcode Command Line Tools (for iOS):
Platform Exceptions
PlatformServiceUninitializedError
Raised when attempting to use platform features without proper initialization. Common causes:MINITAP_API_KEYnot set in environment- No API key provided in PlatformTaskRequest
- Platform service not configured
PlatformServiceError
Base exception for platform service-related errors. Common causes:- Network connectivity issues
- Platform API errors
- Invalid task configuration on platform
- Check network connectivity
- Verify task exists on platform
- Check platform status at platform.minitap.ai