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

Temporary solution for ignoring unhandled exceptions that have been handled via exception event listener. #273

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

UnityAlex
Copy link
Collaborator

This changes the behavior of the UhandledExceptionListener: AppDomain.CurrentDomain.UnhandledException

Adding an UnhandledEvent listener will now change the default behavior of UnhandledExceptions to no longer be fatal. This is a temporary solution until the upstream API proposal: dotnet#101560 has been implemented.

@UnityAlex UnityAlex requested a review from joncham November 6, 2024 13:21
@@ -4767,7 +4767,8 @@ LONG InternalUnhandledExceptionFilter_Worker(
#endif // !TARGET_UNIX

// Send notifications to the AppDomains.
NotifyAppDomainsOfUnhandledException(pParam->pExceptionInfo, NULL, useLastThrownObject, fIsProcessTerminating /*isTerminating*/);
// UNITY: We'll assume for now that if an event is sent that the unhandled exception has been handled until the proposed API: https://github.com/dotnet/runtime/issues/101560 has been implemented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to control this via an exported function or some other mechanism?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could... I figure if we wanted the exception to be fatal we could always terminate from the handler?

@UnityAlex UnityAlex merged commit 2a6749a into unity-main Nov 6, 2024
2 checks passed
@UnityAlex UnityAlex deleted the unity-unhandled-exceptions branch November 6, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants