Hello.
My project includes a widget target that provides interactive widget functionalities. The document "Adding Interactivity to Widgets and Live Activities" says the following:
Additionally, note that the perform() function is marked as throws. Be sure to handle errors instead of rethrowing them, and update your app, widget, and Live Activity as needed. For example, update a widget’s interface to indicate that it displays outdated information if it cannot load new data.
However, I couldn't find a way how to handle an error in an interactive widget. The Button(intent:)
and Toggle(intent:)
initializers don't have mechanisms for error handling.
Does anyone know a solution for handling errors in interactive widgets?