Overview
The Cuey TypeScript client provides typed error classes for different error scenarios. All errors extend fromCueyError and include status codes and error details.
Error Classes
CueyError
Base error class for all Cuey API errors.Base error class extending JavaScript’s
Error.UnauthorizedError (401)
Thrown when the API key is invalid or missing.Extends
CueyError. Thrown when authentication fails.NotFoundError (404)
Thrown when a requested resource doesn’t exist.Extends
CueyError. Thrown when a resource is not found.BadRequestError (400)
Thrown when the request is invalid (e.g., trying to update a non-pending event).Extends
CueyError. Thrown when the request is invalid.ValidationError (400)
Thrown when request validation fails. Includes detailed validation errors.Extends
CueyError. Thrown when request validation fails.InternalServerError (500+)
Thrown when a server error occurs (e.g., requesting an out-of-range page).Extends
CueyError. Thrown when a server error occurs.Error Codes
Union type of all possible error codes.
Basic Error Handling
Try-Catch Pattern
Handling Validation Errors
Validation errors include detailed information about what failed:Common Error Scenarios
Invalid API Key
Resource Not Found
Invalid Request Data
Updating Non-Pending Event
Out of Range Pagination
Error Handling Utilities
Generic Error Handler
Retry on Specific Errors
Error Type Guards
Best Practices
Always Handle Errors
Provide User-Friendly Messages
Importing Error Classes
Related Resources
Types Reference
See all available types.
Advanced Configuration
Learn about advanced configuration options.
REST API Errors
See REST API error responses.