Skip to main content

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)

CodeNameDescription
4001AUTH_NOT_INITIALIZEDSDK not initialized before auth call
4002AUTH_CANCELLEDUser cancelled the login flow
4003AUTH_INVALID_CREDENTIALSApp ID or Client Secret is incorrect
4004AUTH_TOKEN_EXPIREDAccess token has expired and refresh failed
4005AUTH_NETWORK_ERRORNetwork error during authentication
4006AUTH_POPUP_BLOCKEDBrowser blocked the login popup (Web only)

Purchase Errors (5xxx)

CodeNameDescription
5001PURCHASE_CANCELLEDUser cancelled the purchase
5002PURCHASE_PRODUCT_NOT_FOUNDProduct ID does not exist
5003PURCHASE_ALREADY_OWNEDProduct is already owned (non-consumable)
5004PURCHASE_VERIFICATION_FAILEDServer-side receipt verification failed
5005PURCHASE_STORE_ERRORGoogle Play / App Store returned an error
5006PURCHASE_NETWORK_ERRORNetwork error during purchase verification

General Errors (1xxx)

CodeNameDescription
1001NOT_INITIALIZEDSDK not initialized
1002INVALID_PARAMETERRequired parameter is missing or invalid
1003NETWORK_ERRORGeneral network connectivity error
1004SERVER_ERRORUnexpected server error (2xx response expected)
1005TIMEOUTRequest timed out
1006RATE_LIMITEDToo 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);
}
}