Error Codes
This page lists all error codes returned by VLPlay SDK methods. [PLACEHOLDER] When an SDK call fails, the error object includes a code (integer) and message (string). Use the code for programmatic error handling and display the message (or a localized equivalent) to the player only when appropriate.
[PLACEHOLDER] Errors in the 1xxx range are client-side validation errors. Errors in the 2xxx range indicate server-side issues. Errors in the 4xxx range are authentication-related. Errors in the 5xxx range relate to purchases.
Authentication Errors (4xxx)
| Code | Name | Description |
|---|---|---|
| 4001 | AUTH_NOT_INITIALIZED | SDK not initialized before auth call |
| 4002 | AUTH_CANCELLED | User cancelled the login flow |
| 4003 | AUTH_INVALID_CREDENTIALS | App ID or Client Secret is incorrect |
| 4004 | AUTH_TOKEN_EXPIRED | Access token has expired and refresh failed |
| 4005 | AUTH_NETWORK_ERROR | Network error during authentication |
| 4006 | AUTH_POPUP_BLOCKED | Browser blocked the login popup (Web only) |
Purchase Errors (5xxx)
| Code | Name | Description |
|---|---|---|
| 5001 | PURCHASE_CANCELLED | User cancelled the purchase |
| 5002 | PURCHASE_PRODUCT_NOT_FOUND | Product ID does not exist |
| 5003 | PURCHASE_ALREADY_OWNED | Product is already owned (non-consumable) |
| 5004 | PURCHASE_VERIFICATION_FAILED | Server-side receipt verification failed |
| 5005 | PURCHASE_STORE_ERROR | Google Play / App Store returned an error |
| 5006 | PURCHASE_NETWORK_ERROR | Network error during purchase verification |
General Errors (1xxx)
| Code | Name | Description |
|---|---|---|
| 1001 | NOT_INITIALIZED | SDK not initialized |
| 1002 | INVALID_PARAMETER | Required parameter is missing or invalid |
| 1003 | NETWORK_ERROR | General network connectivity error |
| 1004 | SERVER_ERROR | Unexpected server error (2xx response expected) |
| 1005 | TIMEOUT | Request timed out |
| 1006 | RATE_LIMITED | Too many requests — retry after a delay |
Handling Errors
// Web example
try {
await VLPlaySDK.auth.login();
} catch (error) {
if (error.code === 4002) {
// User cancelled — do nothing
} else if (error.code === 4006) {
alert('Please allow popups for this site to log in.');
} else {
console.error('Login error:', error.code, error.message);
}
}