Overview
All SDK errors extend from the baseSnackBaseError class, allowing you to catch errors generically or handle specific error types:
Error Hierarchy
Error Properties
All errors include the following properties:Error Types
AuthenticationError (401)
Thrown when authentication fails or tokens are invalid:AuthorizationError (403)
Thrown when the user lacks permission for an action:NotFoundError (404)
Thrown when a resource is not found:ConflictError (409)
Thrown when a resource conflict occurs (e.g., duplicate):ValidationError (422)
Thrown when request validation fails:RateLimitError (429)
Thrown when rate limit is exceeded:NetworkError
Thrown when network request fails:TimeoutError
Thrown when request times out:ServerError (500+)
Thrown when server error occurs:Global Error Handlers
Configure global error callbacks:React Error Handling
Retry Logic
Check if error is retryable:Custom Error Handler
Create a custom error handler:Complete Example
Next Steps
- Error Types - Complete error type reference
- Authentication - Authentication error handling
- Configuration - Error callback configuration