Overview
Structured error classes are provided to help you handle failures gracefully. Proper error handling ensures robust applications and better user experience.AuthenticationError
AuthenticationError
This error occurs when your API key is invalid, missing, or revoked.Example:
Always store your API key in environment variables and never commit it to source control.
RateLimitError
RateLimitError
Thrown when you exceed the allowed number of requests per time period.Example:
Implement exponential backoff or retry logic when handling rate limits.
NetworkError
NetworkError
Occurs when network connectivity issues prevent a request from completing.Example:
Check your network connection or retry requests in case of transient failures.
SectonError (Generic)
SectonError (Generic)
Catches any other SDK-related errors that do not fall under the specific categories.Example:
Use this as a fallback to catch unexpected issues.