Learn how to handle errors gracefully, implement robust reconnection strategies, and follow production-ready best practices for gRPC streaming in Python.Documentation Index
Fetch the complete documentation index at: https://docs.polymarket.us/llms.txt
Use this file to discover all available pages before exploring further.
gRPC Status Codes
gRPC uses standard status codes to indicate errors. Understanding these codes is essential for proper error handling in Python.Common Status Codes
| Code | Name | Description | Action |
|---|---|---|---|
0 | OK | Success | Continue processing |
1 | CANCELLED | Operation canceled | Clean up resources |
3 | INVALID_ARGUMENT | Invalid request parameters | Fix request and retry. See Request Parameters for details. |
4 | DEADLINE_EXCEEDED | Operation timeout | Retry with backoff |
7 | PERMISSION_DENIED | Insufficient permissions | Check account permissions |
14 | UNAVAILABLE | Service unavailable | Reconnect with backoff |
16 | UNAUTHENTICATED | Authentication failed | Refresh token and retry |
Checking Error Codes in Python
Common Errors and Solutions
1. UNAUTHENTICATED - Authentication Failed
Causes:- Invalid access token
- Expired access token
- Missing authorization metadata
2. UNAVAILABLE - Service Unavailable
Causes:- Network connectivity issues
- Server temporarily unavailable
- Firewall blocking connection
3. INVALID_ARGUMENT - Bad Request
Causes:- Invalid symbol
- Invalid depth value
- Malformed request
Next Steps
Authentication
Review authentication best practices
Market Data Stream
Learn about market data streaming
Order Stream
Learn about order streaming