Android SDK Errors
The Android Weavr Provisioning SDK wraps errors within a class called WPPException
.
This exception is not thrown, but rather wrapped within an Outcome.Failure
type.
The main way to identify which error occurred is via the WPPException.code
and WPPException.domain
properties.
The first one is an integer representing which error occurred, while the second identifies which subsystem created the error.
Additionally, extra data may be included, and an exception may occur in WPPException.extraData
and WPPException.cause
.
Potential error codes
All potential error codes are gathered in WeavrSDKErrorCodes
.
The following table lists all potential error codes that the SDK may throw:
Error Code | Value | Description |
---|---|---|
SDK_NOT_INITIALISED | 1000 | The SDK was not initialised before calling a method. |
CARD_NOT_PROVISIONED | 1001 | The card is not provisioned. |
NETWORK_ERROR | 1002 | There is no network connection. |
CARD_NOT_ELIGIBLE | 1003 | The card is not eligible to be provisioned. |
MISSING_ADD_TO_WALLET_DRAWABLE | 2001 | The AddToWalletButton is missing the required drawable resource. Ensure you have set a drawable resource when creating the button. |
UNAUTHORIZED | 2002 | The provisioning failed because the token is unauthorized. |
MISSING_CARD_ID | 2003 | The AddToWalletButton is missing the required card ID. |
MISSING_CARD_BRAND | 2004 | The AddToWalletButton is missing the required card brand. |
MISSING_CARD_LAST_FOUR_DIGITS | 2005 | The AddToWalletButton is missing the required last four digits of the card. |
MISSING_CARD_HOLDER_NAME | 2006 | The AddToWalletButton is missing the required card holder name. |
MISSING_CARD_DESCRIPTION | 2007 | The AddToWalletButton is missing the required card description. |
GOOGLE_PAY_PROVISIONING_PAYLOAD_ERROR | 3001 | There was a problem with the Google Pay SDK. |
INSECURE_DEVICE_ERROR | 3002 | The device is not considered secure. This can be triggered in scenarios such as debugging attached to the device, unsupported OS versions, or failed hardware ID retrieval. |
CLIENT_NOT_AVAILABLE_ERROR | 3003 | The client is not available. |
GOOGLE_PAY_ERROR | 3004 | There was a problem with the Google Pay SDK. |
GOOGLE_PAY_TOKEN_ALREADY_EXISTS | 3005 | The Google Pay token is already provisioned. |
GOOGLE_PAY_TOKEN_NOT_FOUND | 3006 | The Google Pay token was not found. |
SETUP_ERROR | 4001 | There's a setup issue within the app. |
INVALID_ACTIVITY | 5001 | The activity provided is invalid. A FragmentActivity, preferably an AppCompatActivity, is expected. |
UNKNOWN_ERROR | -1 | An unknown error occurred. |