Unhandled exception event doesn't trigger?

Is this one of those things that aren’t supposed to work in Unity?

[InitializeOnLoad]
public class EditorOnLoad  { 

     static EditorOnLoad()
        {
            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.UnhandledException += currentDomain_UnhandledException;
            
        }
    
    static void currentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            GlobalManager.KillPeer();
        }
    }

How about using Application.RegisterLogCallback? Don’t forget to check the logtype