> 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 del SDK: Proporciona el tipo de error que ocurrió.
* Código de error del servidor: El código numérico del error para indicar el error causado en el 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 recuperar 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 recuperar un texto descriptivo del error.

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

## MGErrorCode

`MGErrorCode` es el `enum` 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 Javadoc para 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 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/es/help/error-management/mg-error-management.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.
