---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAAppMetricaPluginReporting.md
  - https://appmetrica.yandex.by/docs/ru/sdk/ios/analytics/objectivec/AMAAppMetricaPluginReporting.md
  - href: en/sdk/ios/analytics/objectivec/AMAAppMetricaPluginReporting.md
    type: text/markdown
    title: Markdown version
  - href: ../../../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.by/docs/en/llms.txt

# AMAAppMetricaPluginReporting protocol
The `AMAAppMetricaPluginReporting` protocol is an extension of `AMAAppMetricaCrashReporting`.

You can get an instance of the object that implements `AMAAppMetricaPluginReporting` by calling the [pluginExtension](https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAAppMetricaCrashReporting.md#method_pluginExtension) method in [AMAAppMetricaCrashReporting](https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAAppMetricaCrashReporting.md).

One `AMAAppMetricaPluginReporting` instance is created for each reporter. You can request it every time or store a reference for future use.

## Instance methods {#instance_summary}

#|
|| [-reportUnhandledException:onFailure:](#method_reportUnhandledException_onFailure) | Sends an unhandled error message. ||
|| [-reportError:message:onFailure:](#method_reportError_message_onFailure) | Sends an error message. ||
|| [-reportErrorWithIdentifier:message:details:onFailure:](#method_reportErrorWithIdentifier_message_details_onFailure) | Sends an error message with a short description. ||
|#

## Method descriptions {#method_detail}

### -reportUnhandledException:onFailure: {#method_reportUnhandledException_onFailure}

```objectivec translate=no
- (void)reportUnhandledException:(AMAPluginErrorDetails *)errorDetails
                       onFailure:(nullable void (^)(NSError *error))onFailure
reportUnhandledException(exception:onFailure:);
```

Sends a  message about an unhandled error. For more information, see [AMAPluginErrorDetails](https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAPluginErrorDetails.md).

**Parameters:**

#|
|| `errorDetails` | Object that describes the error. ||
|| `OnFailure` | Callback method to call if an error occurs while sending the message. The `error` is passed as an argument. ||
|#

### -reportError:message:onFailure: {#method_reportError_message_onFailure}

```objectivec translate=no
- (void)reportError:(AMAPluginErrorDetails *)errorDetails
            message:(nullable NSString *)message
          onFailure:(nullable void (^)(NSError *error))onFailure
reportError(error:message:onFailure:);
```

Sends a custom error message. Errors are grouped using `backtrace`. To change the grouping parameter, use [-reportErrorWithIdentifier:message:details:onFailure:](#method_reportErrorWithIdentifier_message_details_onFailure). For more information, see [AMAPluginErrorDetails](https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAPluginErrorDetails.md).

**Parameters:**

#|
|| `errorDetails` | Object with error details. ||
|| `message` | Short error description. ||
|| `OnFailure` | Callback method to call if an error occurs while sending the message. The `error` is passed as an argument. ||
|#

### -reportErrorWithIdentifier:message:details:onFailure: {#method_reportErrorWithIdentifier_message_details_onFailure}

```objectivec translate=no
- (void)reportErrorWithIdentifier:(NSString *)identifier
                          message:(nullable NSString *)message
                          details:(nullable AMAPluginErrorDetails *)errorDetails
                        onFailure:(nullable void (^)(NSError *error))onFailure
reportError(identifier:message:error:onFailure:);
```

Sends an error message with a short description. Errors are grouped by the passed ID. To group them using `backtrace` instead, use the [-reportError:message:onFailure:](#method_reportError_message_onFailure) method. For more information, see [AMAPluginErrorDetails](https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAPluginErrorDetails.md).


**Parameters:**

#|
|| `identifier` | ID used for grouping. ||
|| `message` | Short error description. ||
|| `errorDetails` | Object with error details.  ||
|| `OnFailure` | Callback method to call if an error occurs while sending the message. The `error` is passed as an argument. ||
|#
