Google Calendar Error Handlers
Built-in and custom error handling for Google Calendar
The Google Calendar plugin includes comprehensive error handling with built-in handlers for common error scenarios. You can also add custom error handlers to handle specific cases in your application.
New to Corsair? Learn about core concepts like error handling and retry strategies before customizing error handlers.
Full Implementation: For the complete, up-to-date error handler implementations, see the Google Calendar plugin source code on GitHub.
Built-in Error Handlers
The Google Calendar plugin automatically handles common error scenarios with sensible retry strategies.
Rate Limit Errors
Triggers: HTTP 429 status
Behavior:
- Maximum retries: 5
- Uses exponential backoff between retries
Authentication Errors
Triggers: HTTP 401 status, or error messages containing "Invalid Credentials" or "Token expired"
Behavior:
- Maximum retries: 0 (no retries)
- Logs error to console
- Fails immediately for manual intervention
Permission Errors
Triggers: HTTP 403 status
Behavior:
- Maximum retries: 0 (no retries)
- Logs warning to console
- Fails immediately
Resource Not Found Errors
Triggers: HTTP 404 status
Behavior:
- Maximum retries: 0 (no retries)
- Logs warning to console
- Fails immediately
Network Errors
Triggers: Network-related error messages
Behavior:
- Maximum retries: 3
- Uses exponential backoff
- Logs warning to console
Default Error Handler
Triggers: Any error not matched by other handlers
Behavior:
- Maximum retries: 0 (no retries)
- Logs error to console
- Fails immediately
Custom Error Handlers
You can add custom error handlers to handle specific scenarios:
googlecalendar({
errorHandlers: {
CUSTOM_ERROR: {
match: (error, context) => {
return error.message.includes("custom_error_code");
},
handler: async (error, context) => {
return {
maxRetries: 2,
};
},
},
},
})For comprehensive error handling strategies, patterns, and best practices, see the Error Handling concepts page.