<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppIntentError/init(wrapping:)-4967l",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A11IntentErrorV8wrappingACx_tc10Foundation40CustomLocalizedStringResourceConvertibleRzs0D0Rzlufc"
  },
  "title" : "init(wrapping:)"
}
-->

# init(wrapping:)

Creates an error by wrapping an existing localized error.

```
init(wrapping error: some CustomLocalizedStringResourceConvertible & Error)
```

## Parameters

`error`

The error to wrap.

## Discussion

Conform your custom `Error` to <doc://com.apple.documentation/documentation/Foundation/CustomLocalizedStringResourceConvertible>
to provide a localized description of the error.

The system calls this initializer for errors thrown from
[`perform()`](/documentation/AppIntents/AppIntent/perform()) that conform to `CustomLocalizedStringResourceConvertible`.

If the error conforms to both `CustomLocalizedStringResourceConvertible` and [`CustomAppIntentErrorConvertible`](/documentation/AppIntents/CustomAppIntentErrorConvertible), the
system uses only [`CustomAppIntentErrorConvertible`](/documentation/AppIntents/CustomAppIntentErrorConvertible).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)