corsair.ts
Error Handler Hierarchy
Corsair checks for error handlers in this order:- Plugin-specific error — e.g., Slack rate limit handler
- Root-level error — e.g., global rate limit handler for all integrations
- Plugin default — e.g., default Slack error handler
- Root default — default handler for all integrations
- Corsair fallback — built-in handler that fails gracefully
Plugin-Level Handler
Handle errors specific to a single integration.corsair.ts
Root-Level Handler
Handle errors across all integrations.corsair.ts
Default Handler
Catch any error that doesn’t match a specific handler.corsair.ts
No Handler Needed
You don’t have to define any error handlers. Corsair provides sensible defaults that ensure your application fails gracefully. Start simple and add handlers as needed.corsair.ts
Retry Strategies
When returning from an error handler, you can specify:maxRetries— number of retry attemptsretryStrategy—"exponential_backoff_jitter"or other strategies