SDK-specific error handling patterns with type safety and automatic recovery
{ data, error }
Patterndata
and error
properties, allowing for easy, type-safe error handling.
Authentication Errors
UNAUTHORIZED
- Invalid or expired tokenTOKEN_EXPIRED
- Token needs refresh (handled automatically)INVALID_CREDENTIALS
- Login failedValidation Errors
VALIDATION_ERROR
- Field validation failedINVALID_INPUT
- Malformed request dataCONSTRAINT_VIOLATION
- Business rule violationResource Errors
NOT_FOUND
- Resource doesn’t existACCESS_DENIED
- Insufficient permissionsRESOURCE_CONFLICT
- Conflicting operationNetwork Errors
NETWORK_ERROR
- Connection failedTIMEOUT
- Request timed outUNAUTHORIZED
- Authentication failed