Global Exception Handling IOS will always terminate the app #33052
Unanswered
m-bakker-dgoffice
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When implementing global exception handling in a .NET MAUI application, I’ve noticed that we can catch errors with a global exception handling but this does not prevent the app from terminating.
Even with global exception handling (e.g., using AppDomain.CurrentDomain.UnhandledException or TaskScheduler.UnobservedTaskException), the app still terminates after an unhandled exception occurs. There seems to be no way to prevent the termination and allow the app to continue running gracefully.
On android It is possible to catch and handle global exceptions without forcing the app to terminate. I can implement custom logic to display an error page without closing the app.
with this code:
Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) => { args.Handled = true; UnhandledException?.Invoke(sender, new UnhandledExceptionEventArgs(args.Exception, true)); };Is this not possible on IOS?
Beta Was this translation helpful? Give feedback.
All reactions