Error Codes
All SDK error codes for programmatic error handling.
Type tables on this page are generated directly from the SDK source code at build time.
Error Codes
The SDK uses typed error codes for programmatic error handling:
| Code | Category | Description |
|---|---|---|
AUTH_FAILED | Authentication | Authentication attempt failed |
AUTH_TIMEOUT | Authentication | Authentication timed out (default: 60s) |
SESSION_EXPIRED | Authentication | User session has expired |
NETWORK_ERROR | Network | Network request failed |
API_ERROR | Network | API returned an error response |
INVALID_CONFIG | Configuration | Invalid SDK configuration provided |
COMPONENT_LOAD_FAILED | Component | Component failed to load in iframe |
RATE_LIMITED | Rate Limiting | Too many requests |
Error Object
All errors conform to the ComponentError interface:
Prop
Type
Handling Errors
VisaAcceptance.init({
onError: (error) => {
switch (error.code) {
case 'AUTH_FAILED':
if (error.retryable) {
showReAuthPrompt();
}
break;
case 'NETWORK_ERROR':
showRetryBanner();
break;
case 'RATE_LIMITED':
backoff(error.details?.retryAfter);
break;
default:
reportToSentry(error);
}
}
});Retryable Errors
Errors with retryable: true can be recovered from:
AUTH_FAILED— prompt user to re-authenticateAUTH_TIMEOUT— retry with longer timeout or prompt loginNETWORK_ERROR— retry after brief delayRATE_LIMITED— retry afterretryAfterperiod
Non-retryable errors (INVALID_CONFIG, COMPONENT_LOAD_FAILED) indicate a code or configuration issue that requires a fix.