SDK errors (Android push provisioning)
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 | Scenario | Recommended Action |
|---|---|---|
SDK_NOT_INITIALISED (1000) | Initialisation missing | Initialise in application before any call. |
CARD_NOT_PROVISIONED (1001) | Attempting to set default for unknown card | Prompt user to add card first. |
NETWORK_ERROR (1002) | Connectivity issues | Retry with backoff; surface offline state. |
CARD_NOT_ELIGIBLE (1003) | Backend flagged card ineligible | Show user-friendly message; escalate to issuer. |
COULD_NOT_FETCH_PROVIDER (1004) | Missing routing data | Validate backend response and provisioning config. |
MISSING_\* (2001–2007) | AddToWalletButton missing parameters | Ensure all fields set before user taps. |
GOOGLE_PAY_\* (3001–3006) | Google Pay SDK issues | Provide fallback or retry guidance. |
SETUP_ERROR (4001) | Local app misconfiguration | Revisit installation steps. |
INVALID_ACTIVITY (5001) | Non-FragmentActivity host | Use AppCompatActivity or attach fragment correctly. |
UNKNOWN_ERROR (-1) | Unmapped exception | Capture logs for support. |