Skip to main content
The Orchata SDK throws typed errors for different scenarios, making error handling straightforward and type-safe.

Error Types

Import error classes to handle specific error types:

Basic Error Handling

Handle errors with try-catch blocks:

Error Types Reference

Rate Limit Handling

Handle rate limits with retry logic:

Error Properties

All error instances include useful properties:

RateLimitError Properties

RateLimitError includes additional properties:

Type-Safe Error Handling

TypeScript provides full type safety for error handling:

Common Error Scenarios

Invalid API Key

Resource Not Found

Validation Errors

Network Issues

Error Handling Best Practices

Handle Specific Errors

Catch specific error types to provide better user feedback and handle each case appropriately.

Retry Rate Limits

Implement retry logic for RateLimitError using the retryAfter property.

Log Errors

Log errors with context (request details, user ID, etc.) for debugging.

Graceful Degradation

Provide fallback behavior when errors occur (e.g., show cached data or default message).

Next Steps

Usage Guide

Learn about Spaces, Documents, and Queries APIs.

AI Integration

Integrate with Vercel AI SDK for AI-powered applications.

Quickstart

Review the quickstart guide.

API Reference

Explore the REST API documentation.