init(predefinedError:description:)
Creates an error from a predefined error with a custom localized description.
Declaration
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 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().