-
Notifications
You must be signed in to change notification settings - Fork 546
Closed
Labels
enhancementThe issue or pull request is an enhancementThe issue or pull request is an enhancement
Milestone
Description
Steps to Reproduce
- Have any exception bubble through to the UI loop
- Observe the app crashes with SIGABRT
- By adding a try/catch around NSApplicationMain you catch the exception but the application's main loop still stops.
This can be seen with native shell implementations of VSMac.
Expected Behavior
Xamarin.Mac should provide some event to listen on for uncaught exceptions. That would allow applications to avoid crashes most of the time, by having the main loop driven by the toolkit handling them.
See the equivalent WPF API here: https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.dispatcherunhandledexception?redirectedfrom=MSDN&view=net-5.0
Actual Behavior
The exception bubbles through to NSApplicationMain caller, because there is no manual RunLoop handling happening on Xamarin.Mac's side. That means, we let AppKit handle running the loop iterations, so we have no ability to get monitor for exceptions.
Metadata
Metadata
Assignees
Labels
enhancementThe issue or pull request is an enhancementThe issue or pull request is an enhancement