-
Notifications
You must be signed in to change notification settings - Fork 107
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
Feature request: Exception callbacks #1571
Comments
If the mentioned bug was to get fixed for most scenarios to possibly propagate the error message, would we still want this custom first chance Unhandled exception handler? |
This event would be raised in many non-server scenarios, for example if native code calls in-proc into managed. This also seems trivial to implement for specific classes that are used out-of-proc by adding the try/catch yourself. |
I also don't really like this change. It's not pay for play and requires extra checks on every single handled exception for every WinRT type ever, even though 99.999% of them will never actually need this. It also has a slight binary size increase due to all that additional code in every single generated marshalling stub. Especially if there's a workaround, I'm not a fan of this. |
If #1562 gets fixed, I think we may not need this so urgently. The inability to intercept unhandled exceptions on the server in managed code means that we are not able to capture the stacktrace. |
The check only happens when an exception on WinRT server is unhandled from managed code. |
Proposal: Exception callbacks
Summary
In out-of-proc scenario, we can only see
COMException
without any message from the client if any unhandled exception happens on the server (see #1562).We cannot intercept it without wrapping every API with a try-catch block. This makes it difficult to do unified unhandled exception handling and logging.
I propose to add the support for exception callbacks which allows propagate the exception to a user specified handler to handle unhandled exceptions:
WinRT codegen
Usage
The text was updated successfully, but these errors were encountered: