What is the Unity Crash Handler? Do I need it?

When I create my standalone build for my game, it creates two programs: one is the actual game and the other is a “Unity Crash Handler 64”
What does this crash handler do? Do I need it or could I delete it before I try to distribute my game?
I double-clicked on it by accident a couple times and nothing seemed to open.

If the game crashes it shows the user a popup and it can send a report back to the developer.

Hey, do you guys know how Unity starts the crash handler process? Using what API? I’d like to disable the launch of the process completely.

So this “UnityCrashHandler” when crashing the game, sends that information to the game developer, as Unreal Engine ???
7369868--898370--upload_2021-7-28_18-5-4.png

7369868--898370--upload_2021-7-28_18-5-4.png

It sends data to the developer if they’re using Unity Cloud Diagnostics. It also captures the dump file of the crash game and writes it to disk, even the game developer hasn’t configured anything (so you could send it to them manually).

If you delete it, Unity crash handler will not launch (obviously!), but I’m not sure why you’d want to do that as then investigating crashes in the wild becomes 10x harder.

1 Like

I am not seeing what is described in this thread. There is no pop-up informing the user that an exception/crash happened, the game keeps chugging along. Yes, a report is sent to Cloud Diagnostics, which is usually partially useless it the lacks a proper stacktrace. But once an exception occur in a run if often happens again - had a report come in that the same exception was listed over 600 times, as it was triggered every frame. The player had no idea and wondered by his unit wasn´t responding as it should. A crash would atleast have let him know…

The crash handler only handles hard application crashes, not C# exceptions in your code. You can subscribe to this event to react to unexpected C# exceptions: https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception?view=net-5.0

1 Like

Already tried this, but it doesn’t work as the UnityEngine.CrashReportHandler.CrashReportHandler already grabs the exception.

The only, very-very dirty way today, as CrashReportHandler doesn’t have an event, is to subscribe to:
Application.RegisterLogCallback(new Application.LogCallback(HandleLog));

And in the callback filter on any LogType.Exception and then handle ones cleanup (go back to main menu or whatever it is one want to do).

1 Like

yep! I have the same problem.
I need to subscribe to something to update data in “CrashReportHandler.SetUserMetadata”, but can’t find any event I could use before Unity handle a crash or any exception