How to make exception_unhandled_handler useful?

SnoutUp

Member
Hello there,

I've been dreaming about crashing my games nicely for a long time and decided to spend my Sunday trying to work something out with that new exception_unhandled_handler, but... failed. Now it's somewhat decent on Windows, since I can add a little joke to the crash message to make it look less threatening, but if I display it via show_message it means that players don't get an option to copy the output easily without taking a screenshot. I tried using show_error hoping that it will use the old error dialog which is more accessible, but for some reason show_error invokes unhandled exception (doesn't matter if abort flag was set to true or false) and that crashes the game even harder.

After giving up on Windows, I was hoping I'd be able to set up that exception handler on Android and send the crash log to GameAnalytics or at least strip all those "#" symbols out of error message, so it would fit on screen when players take screenshots for reporting, but after crashing the game exits in a way that it kills all dialogs and likely webservice calls instantly.

How do you use it? Was anyone able to set it up on mobile?

I guess I'll try sending crashes to GameAnalytics on desktop version and hope at least that works.

On a related note, maybe it's time to update the default crash template? Because it looks like a cruel joke on mobile.

1606657010139.png
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
The way you'd handle it, regardless of platform, is by saving the error message into a file and then checking if such a file exists on game start, asking the player if they want to send an error report or not.
 

SnoutUp

Member
The way you'd handle it, regardless of platform, is by saving the error message into a file and then checking if such a file exists on game start, asking the player if they want to send an error report or not.
Ah, alright, that's a good option, but it would mean completely silent crash on mobile..? I guess that's a decent trade off as long as I'm getting the data and can fix more crashes.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Ah, alright, that's a good option, but it would mean completely silent crash on mobile..? I guess that's a decent trade off as long as I'm getting the data and can fix more crashes.
That might be a thing to report - perhaps implementation-specific
 
Ah, alright, that's a good option, but it would mean completely silent crash on mobile..? I guess that's a decent trade off as long as I'm getting the data and can fix more crashes.
Hi @SnoutUp, just curious - how did you resolve this in the end? I'm now struggling with the same issue on Android and I'm still stuck with exactly what you described - silent crash, nothing gets sent to Game Analytics :)
 

SnoutUp

Member
Hi @SnoutUp, just curious - how did you resolve this in the end? I'm now struggling with the same issue on Android and I'm still stuck with exactly what you described - silent crash, nothing gets sent to Game Analytics :)
Sorry for the late response, but like YellowAfterlife suggested, I started writing crash details to the file and sending report to GA on the next launch.
 

Juju

Member
I wrote a library a while ago to demonstrate usage of exception_unhandled_handler. If you jump across onto the dev branch then you can see an implementation of automatic crash logging to sentry.io (as well as lots of other logging behaviours)

 
Sorry for the late response, but like YellowAfterlife suggested, I started writing crash details to the file and sending report to GA on the next launch.
Thanks - that's what I ended up going with too, but I still don't like the fact that it prevents error messages from showing up to players on Android. So in the end, I stopped using it, for the sake of avoiding silent crashes which are pretty frustrating for players as they have no idea what went wrong and I can't help them, unless it's clear from the analytics data what their specific problem is.

I wrote a library a while ago to demonstrate usage of exception_unhandled_handler. If you jump across onto the dev branch then you can see an implementation of automatic crash logging to sentry.io (as well as lots of other logging behaviours)
Thanks, I'll check it out! Just curious - does it work for you on Android as well? I had no issues with using custom error messages and automatically logging them on desktop version, but Android just doesn't seem to work... No error messages are showing, no events are being sent (except for when using the crash.txt solution which sends it on next startup).
 

RizbIT

Member
Does exception_unhandled_handler () have to be put in the step event or just called once say in game start event?
 
Top