---
metadata:
  - name: generator
    content: Diplodoc Platform v5.66.1
alternate:
  - https://appmetrica.yandex.com/docs/en/sdk/ios/analytics/objectivec/AMAError.md
  - https://appmetrica.yandex.com/docs/ru/sdk/ios/analytics/objectivec/AMAError.md
  - https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/objectivec/AMAError.md
  - href: https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/objectivec/AMAError.md
    type: text/markdown
    title: Markdown version
  - href: https://appmetrica.yandex.com/docs/zh/llms.txt?revision=r22038627
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.com/docs/zh/llms.txt?revision=r22038627

# AMAError 类

对 [AMAErrorRepresentable](https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/objectivec/AMAErrorRepresentable.md) 协议的简单实现。

## Instance methods {#instance_summary}

#|
|| +[errorWithIdentifier:](#method_errorWithIdentifier) | 使用指定的 ID 创建 `AMAError` 实例。 ||
|| +[errorWithIdentifier:message:parameters:](#method_method_errorWithIdentifier_message_params) | 创建具有指定 ID 和其他参数的 `AMAError` 实例。 ||
|| +[带标识符的错误:消息:参数:回溯:底层错误:](#method_errorWithIdentifier_message_params_backtrace_underlyingError) | 使用指定的 ID 和其他参数创建 `AMAError` 实例。 ||
|#

## Method descriptions {#method_detail}

### +errorWithIdentifier: {#method_errorWithIdentifier}

```objectivec translate=no
+ (nonnull instancetype)errorWithIdentifier:(nonnull NSString *)identifier;
```

使用指定的 ID 创建 `AMAError` 实例。

**参数：**

#|
|| `identifier` | Error ID. AppMetrica 用它来对错误进行分组。 ||
|#

**返回：**

The `AMAError` 类实例。

### +带标识符的错误:消息:参数: {#method_method_errorWithIdentifier_message_params}

```objectivec translate=no
+ (nonnull instancetype) errorWithIdentifier:(nonnull NSString *)identifier
                                     message:(nullable NSString *)message
                                  parameters:(nullable NSDictionary<NSString *, id> *)parameters;
```

使用指定的 ID 和其他参数创建 `AMAError` 实例.

**参数：**

#|
|| `identifier` | Error ID. AppMetrica 用它来对错误进行分组。 ||
|| `message` | 任意错误描述。 ||
|| `参数` | 附加的错误参数。 ||
|#

**返回：**

The `AMAError` 类实例。

### 带标识符的错误:信息:参数:回溯:底层错误 {#method_errorWithIdentifier_message_params_backtrace_underlyingError}

```objectivec translate=no
+ (nonnull instancetype) errorWithIdentifier:(nonnull NSString *)identifier
                                     message:(nullable NSString *)message
                                  parameters:(nullable NSDictionary<SString *, id> *)parameters
                                   backtrace:(nullable NSArray<NSNumber *> *)backtrace
                             underlyingError:(nullable id<AMAErrorRepresentable>)underlyingError;
```

使用指定的 ID 和其他参数创建 `AMAError` 实例。

**参数：**

#|
|| `identifier` | Error ID. AppMetrica 使用它来对错误进行分组。 ||
|| `message` | 任意错误描述。 ||
|| `参数` | 附加的错误参数。 ||
|| `backtrace` | 自定义错误回溯。 ||
|| `underlyingError` | 匹配[AMAErrorRepresentable](https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/objectivec/AMAErrorRepresentable.md)协议的错误实例。 ||
|#

**返回：**

The `AMAError` 类实例。
