Error Response Format
All news errors follow a consistent structure with detailed information for debugging:News Subscription Error Codes
These errors are specific to news subscription operations and should be handled appropriately in your application.
Official WebSocket Error Codes
Based on the official API documentation, these are the only WebSocket error codes:Error Code | Description | Action |
---|---|---|
AUTHENTICATION_FAILED | API key authentication failed | Check API key |
NOT_AUTHENTICATED | Client not authenticated, reconnection required | Reconnect |
SUBSCRIPTION_FAILED | Subscription setup failed | Check parameters |
WEBSOCKET_NOT_SUPPORTED | WebSocket not available on current plan | Upgrade plan |
Error Handling Strategy
Implementation Examples
Authentication Error Handling
Reconnection for Lost Authentication
Error Details by Code
AUTHENTICATION_FAILED
Cause: API key authentication failed Common Issues:- Invalid API key format (must start with
byul_v2_
) - API key doesn’t exist
- API key has been revoked
NOT_AUTHENTICATED
Cause: Client not authenticated, reconnection required Common Issues:- Connection dropped during authentication
- Session expired
- Authentication state lost
SUBSCRIPTION_FAILED
Cause: News subscription setup failed Common Issues:- Invalid
minImportance
value (must be 0-10) - Invalid
limit
value (must be 1-100) - Invalid subscription parameters
WEBSOCKET_NOT_SUPPORTED
Cause: WebSocket not available on current plan Affected Plans: Test (Free), Starter (99/month) or Enterprise planClient-Side Validation
Best Practices
Error Logging- Log all errors with full context for debugging
- Include timestamp and user session information
- Monitor error rates and patterns
- Provide clear, actionable error messages
- Show suggestions when available (e.g., symbol suggestions)
- Implement graceful degradation for non-critical errors
- Implement automatic retry for transient errors
- Respect rate limits and retry-after headers
- Clean up failed subscriptions to prevent limit issues