<!--
{
  "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(predefinedError:description:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A11IntentErrorV010predefinedD011descriptionA2C_10Foundation23LocalizedStringResourceVtcfc"
  },
  "title" : "init(predefinedError:description:)"
}
-->

# init(predefinedError:description:)

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

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

## Parameters

`predefinedError`

The predefined error to throw.

`description`

A custom localized description of the error.

## Discussion

Use this initializer to create one of the predefined [`AppIntentError`](/documentation/AppIntents/AppIntentError) values with a custom message specific to your app’s context.

See the predefined static properties on [`AppIntentError`](/documentation/AppIntents/AppIntentError) for the list of accepted values.
Passing any other [`AppIntentError`](/documentation/AppIntents/AppIntentError) value triggers a runtime failure via `fatalError()`.

---

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)