> 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/es/help/error-management/mg-error-management.md).

# Gestión de errores de MG

## Resumen

Esta sección cubre los errores que pueden devolverse desde el módulo MG. Por ejemplo, al usar el servicio `MGCardEnrollmentService`.

## MobileGatewayError

En el módulo MG, todos los errores se gestionan a través del `MobileGatewayError` objeto.

La estructura del `MobileGatewayError` objeto es la siguiente:

* Código de error SDK: proporciona el tipo de error que se produjo.
* Código de error del servidor: el código numérico del error para indicar el error causado del lado del servidor.
* Código de error HTTP: el código de estado HTTP causado por errores de comunicación.
* Mensaje: una descripción del error.

Los errores deben analizarse de la siguiente manera:

1. `getSDKErrorCode()`- para obtener el tipo de error.
2. Si el tipo es :
   * `SERVER_ERROR`, use `getServerErrorCode()` para obtener el error exacto que ocurrió en el servidor MG.
   * `HTTP_ERROR`, use `getHTTPStatusCode()` para obtener el código de estado HTTP causado por el error de comunicación.
3. Use `getMessage()` para obtener un texto descriptivo del error.

{% hint style="info" %}
Para más detalles sobre MobileGatewayError, consulte [API de Android](/nfc-wallet-sdk-android/es/android-api.md)
{% endhint %}

## MGErrorCode

`MGErrorCode` es el `enumeración` que proporciona todos los códigos de error devueltos por el módulo MG a MPA durante el uso de la API pública del módulo MG. Esto forma parte de la API pública del módulo MG y consulte la Javadoc para obtener detalles sobre cada código de error.

```java
package com.gemalto.mfs.mwsdk.mobilegateway.enrollment;
public enum MGErrorCode {
    NO_INTERNET,
    CONNECTION_TIMEOUT,
    COMMUNICATION_ERROR,
    SERVER_ERROR,
    INTERNAL_ERROR,
    FPAN_NOT_ELIGIBLE,
    UNKNOWN_BIN,
    UNKNOWN_CARD_PRODUCT,
    CARD_PRODUCT_NOT_SUPPORTED,
    INCORRECT_CVV,
    CARD_ALREADY_PROVISIONED_IN_WALLET,
    DEVICE_NOT_ELIGIBLE,
    RESOURCE_NOT_FOUND,
    INCORRECT_AUTHENTICATION_TOKEN,
    CARD_PROVISIONING_COUNT_EXCEEDED,
    UNKONOWN_IDV_METHOD,
    PROVISIONING_NOT_ALLOWED,
    INCORRECT_OTP,
    INCORRECT_OTP_MAX_TRY_EXCEEDED,
    OTP_EXPIRED,
    IDV_METHOD_NOT_AVAILABLE,
    UNEXPECTED_INTERNAL_ERROR,
    EXTERNAL_SYSTEM_UNAVAILABLE,
    UNKNOWN_WALLET_PROVIDER_ID,
    UNKNOWN_WALLET_ID,
    UNKNOWN_DIGITAL_CARD_ID,
    UNKNOWN_CORRELATION_ID,
    CARD_STATE_DOES_NOT_ALLOW_REQUESTED_OPERATION,
    OPERATION_ALREADY_ONGOING,
    OPERATION_FAILED,
    UNKNOWN_DEVICE_ID,
    MISSING_REQUIRED_PARAMETER,
    UNKNOWN_ISSUER_ID,
    UNKNOWN_CARD_ID,
    NO_TNC_RESOURCE_ID,
    INVALID_TNC_DATA_TYPE,
    SECURESTORAGE_WRITE_CONFIG_DATA_ERROR,
    SECURESTORAGE_WIPE_ALL_ERROR,
    CONTEXT_MISSING_ERROR,
    WEB_3DS_AUTHENTICATION_FAILED,
    WEB_3DS_DATA_ERROR,
    INVALID_CARD_DATA,
    NO_CARD_META_DATA,
    CARD_META_DATA_JSON_ERROR,
    NO_CARD_DATA,
    DEVICE_SUSPICIOUS,
    SDK_DATA_VERSION_NOT_SUPPORTED
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
