Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatcher.UIThread.UnhandledException not triggering on MacOS #17759

Open
Whiletru3 opened this issue Dec 12, 2024 · 1 comment
Open

Dispatcher.UIThread.UnhandledException not triggering on MacOS #17759

Whiletru3 opened this issue Dec 12, 2024 · 1 comment

Comments

@Whiletru3
Copy link
Contributor

Whiletru3 commented Dec 12, 2024

Describe the bug

Hello,
I Implement this feature to handle the unhandled exception Dispatcher.UIThread.UnhandledException.
On Windows, the exception is handled and everything is fine.
Using the same code on MacOS, the exception is not handled so the app main loop exit

The feature is explained in this PR : #14432

To Reproduce

in the App.Initialize(), use the Dispatcher.UIThread.UnhandledException. And throw an exception in a viewmodel

Expected behavior

The event should be triggered in MacOS

Avalonia version

11.1.3

OS

macOS

Additional context

This feature is missing in the documentation https://docs.avaloniaui.net/docs/concepts/unhandledexceptions

@Whiletru3 Whiletru3 added the bug label Dec 12, 2024
@maxkatz6
Copy link
Member

Do you have minimal repro, where your exception is raised exactly?
UnhandledException has a quite limited scope of what it can intercept, by design. And it's generally not recommended to rely on.
In short, it only catches exceptions that go through dispatcher, and couldn't be handled by other means. Pretty much the same behavior as in WPF, but they might pass more logic through dispatcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants