How to get all UnhandledExceptions? #19070
Unanswered
AuderixDev
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Thanks for the report. It looks like you're trying to use Wasm Threading, which is experimental at this time in net8 and not working in net9. See this documentation for more details. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
what are the best practices to catch/handle all exceptions?
I want to notify the user about all exceptions.
It doesn't matter if they are thrown by me, are handled or unhandled.
I want to catch all exceptions in the main thread, in tasks, in manged or unmanged code.
The problem with this code:
In WASM not a single exception is caught.
In WinAppSDK exceptions from the main thread are caught, but exceptions from Tasks (TaskScheduler) appears only 60 (?)seconds later.
(iOS and Android not tested)
There is another way:
AppDomain.CurrentDomain.FirstChanceException += (s, e) => { HandleException(e.Exception); };
This works really well in WASM and WinAppSDK to catch all exceptions.
But it catches also a lot of Warnings from WASM that keeps appearing in the Browser Console:
Beta Was this translation helpful? Give feedback.
All reactions