---
title: "init(predefinedError:description:)"
framework: appintents
role: symbol
role_heading: Initializer
path: "appintents/appintenterror/init(predefinederror:description:)"
---

# init(predefinedError:description:)

Creates an error from a predefined error with a custom localized description.

## Declaration

```swift
init(predefinedError: AppIntentError, description: LocalizedStringResource)
```

## Parameters

- `predefinedError`: The predefined error to throw.
- `description`: A custom localized description of the error.

## Discussion

Discussion Use this initializer to create one of the predefined AppIntentError values with a custom message specific to your app’s context. See the predefined static properties on AppIntentError for the list of accepted values. Passing any other AppIntentError value triggers a runtime failure via fatalError().
