What you’ll learn:
- Common error types
- Error handling patterns
- Debugging tips
MetorialAPIError, which includes the error message, HTTP status code, and error type.
Catching Errors
Wrap your Metorial SDK calls in try-catch blocks to handle errors gracefully. Check if the error is aMetorialAPIError to access structured error information.
Common Errors
Here are the most common error types you’ll encounter and how to handle them:AuthenticationError: You have provided an invalid Metorial API key.NotFoundError: The deployment ID doesn’t exist or you don’t have access to it. Double-check your deployment ID in the Metorial dashboard.OAuthRequiredError: The user’s OAuth authorization has expired. Prompt them to re-authorize through the OAuth flow.RateLimitError: You’re making too many requests. Implement exponential backoff and respect rate limit headers.