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

# MG エラー管理

## 概要

このセクションでは、MGモジュールから返される可能性のあるエラーについて説明します。例えばサービスを使用する際に `MGCardEnrollmentService`.

## MobileGatewayError

MGモジュールでは、すべてのエラーは次の方法で管理されます： `MobileGatewayError` オブジェクト。

の構造は次のとおりです： `MobileGatewayError` オブジェクトは次のとおりです：

* SDKエラーコード：発生したエラーの種類を示します。
* サーバーエラーコード：サーバー側で発生したエラーを示す数値コード。
* HTTPエラーコード：通信エラーによって引き起こされたHTTPステータスコード。
* メッセージ：エラーの説明。

エラーは次の方法で解析します：

1. `getSDKErrorCode()`- エラーの種類を取得するために。
2. 種類が次の場合：
   * `SERVER_ERROR`、次を使用します `getServerErrorCode()` MGサーバーで発生した正確なエラーを取得するために。
   * `HTTP_ERROR`、次を使用します `getHTTPStatusCode()` 通信エラーによって引き起こされたHTTPステータスコードを取得するために。
3. 使用する `getMessage()` エラーの説明文を取得するために。

{% hint style="info" %}
MobileGatewayErrorの詳細については、次を参照してください： [Android API](/nfc-wallet-sdk-android/ja/android-api.md)
{% endhint %}

## MGErrorCode

`MGErrorCode` は `enum` は、MGモジュールのパブリックAPIを使用する際にMGモジュールがMPAに返すすべてのエラーコードを提供します。これはMGモジュールのパブリックAPIの一部であり、各エラーコードの詳細についてはJavadocを参照してください。

```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/ja/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.
