> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/help/error-management/cps-error-management/provisioningserviceerror.md).

# ProvisioningServiceError

### Overview

During Tokenization, you use `ProvisioningServiceManager`. If an operation fails, the SDK throws `ProvisioningServiceError`.

Use `ProvisioningServiceError` to read the error category and details:

* `getSdkErrorCode()`: Returns `ProvisioningServiceErrorCodes`.
* `getCpsErrorCode()`: Returns the CPS server error code.
* `getHttpStatusCode()`: Returns the HTTP status code.
* `getErrorMessage()`: Returns a human-readable message.
* `getTokenId()`: Returns the token ID, when card-specific.
* `getStatusAdditionalInfo()`: Returns additional CPS request details, when available.

This section shows how to parse the error.

### Parse the error

When the SDK throws `ProvisioningServiceError`, parse it as follows:

1. Call `getSdkErrorCode()` to retrieve `ProvisioningServiceErrorCodes`.
2. If the code equals `COMMON_COMM_ERROR`, call `getHttpStatusCode()`.
3. If the code equals `COMMON_SERVER_ERROR`, call `getCpsErrorCode()`.
4. Call `getErrorMessage()` to retrieve a descriptive message.
5. If the error is card-specific, call `getTokenId()`.
6. If the error is related to a CPS request, call `getStatusAdditionalInfo()`.

{% hint style="info" %}
Other errors have a similar structure. For details, refer to [Android API](/nfc-wallet-sdk-android/android-api.md).
{% endhint %}

Review all values in `ProvisioningServiceErrorCodes` in [Android API](/nfc-wallet-sdk-android/android-api.md). For example:

* `COMMON_COMM_TIMEOUT_ERROR`: Connection timeout when opening a server connection.
* `COMMON_NO_INTERNET`: No data connection available.

### Server error details

When you receive `COMMON_SERVER_ERROR`, call `getCpsErrorCode()`. Also call `getErrorMessage()`.

Use these classes for known server error codes and messages:

* `KnownCpsErrorCodes`
* `KnownMessageCode`

{% hint style="info" %}
The error codes and error messages listed here are not exhaustive.
{% endhint %}

{% hint style="warning" %}
Do not automatically retry the same request when you receive these errors. Inform the end user. Ask them to contact your support team with the server error code.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/help/error-management/cps-error-management/provisioningserviceerror.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
