init(wrapping:)
Creates an error by wrapping an existing localized error.
Declaration
init(wrapping error: some CustomLocalizedStringResourceConvertible & Error)Parameters
- error:
The error to wrap.
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.