Handle errors and troubleshoot issues with React nekuda.js
Code | Description | Severity |
---|---|---|
VALIDATION_REQUIRED | Required field is empty | Error |
VALIDATION_INVALID | Field value is invalid | Error |
VALIDATION_EXPIRED | Card has expired | Error |
VALIDATION_FORMAT | Incorrect format (e.g., card number) | Error |
VALIDATION_LENGTH | Value too short or too long | Error |
Code | Description | Severity | Recoverable |
---|---|---|---|
NETWORK_TIMEOUT | Request timed out | Warning | Yes |
NETWORK_OFFLINE | No internet connection | Error | No |
NETWORK_CONNECTION_LOST | Connection lost during operation | Warning | Yes |
Code | Description | Severity | Action |
---|---|---|---|
API_UNAUTHORIZED | Invalid or expired API key | Critical | Check public key |
API_FORBIDDEN | Access denied | Critical | Verify permissions |
API_RATE_LIMITED | Too many requests | Warning | Retry after delay |
API_BAD_REQUEST | Invalid request data | Error | Check input |
API_SERVER_ERROR | Server error | Error | Contact support |
NekudaWalletProvider
:
Suggested Action | When Used | Example Implementation |
---|---|---|
retry | Network timeouts, rate limits | Retry after delay |
check_input | Validation errors | Highlight invalid fields |
reauthenticate | Auth errors | Refresh API key |
contact_support | Server errors | Show support contact |
refresh | Iframe issues | Reload the page |
Always Set Both Error Handlers
onValidationError
and onError
on your provider to catch all error types.Check Error Severity
Use Suggested Actions
suggestedAction
field when present for appropriate error recovery.Provide User Feedback
Log Errors
onValidationError
callback