> 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` は `列挙型` これは、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,
    予期しない内部エラー,
    外部システムが利用できません,
    不明なウォレットプロバイダーID,
    不明なウォレットID,
    不明なデジタルカードID,
    不明な相関ID,
    カードの状態では要求された操作を許可できません,
    すでに操作が進行中です,
    操作に失敗しました,
    不明なデバイスID,
    必須パラメーターがありません,
    不明なイシュアID,
    不明なカードID,
    TNCリソースIDがありません,
    無効なTNCデータ型,
    SecureStorageの設定データの書き込みエラー,
    SecureStorageの全消去エラー,
    コンテキスト欠落エラー,
    Web 3DS認証に失敗しました,
    Web 3DSデータエラー,
    無効なカードデータ,
    カードメタデータがありません,
    カードメタデータJSONエラー,
    カードデータがありません,
    疑わしいデバイス,
    SDKデータのバージョンはサポートされていません
}
```


---

# 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.
