---
title: "init(wrapping:)"
framework: appintents
role: symbol
role_heading: Initializer
path: "appintents/appintenterror/init(wrapping:)-4967l"
---

# init(wrapping:)

Creates an error by wrapping an existing localized error.

## Declaration

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

## Parameters

- `error`: The error to wrap.

## Discussion

Discussion Conform your custom Error to CustomLocalizedStringResourceConvertible to provide a localized description of the error. The system calls this initializer for errors thrown from perform() that conform to CustomLocalizedStringResourceConvertible. If the error conforms to both CustomLocalizedStringResourceConvertible and CustomAppIntentErrorConvertible, the system uses only CustomAppIntentErrorConvertible.
