#Godot 4.5 Crash Logging (with gdscript)

10 messages · Page 1 of 1 (latest)

topaz birch
#

Hi Sentry team!

I'm testing out Sentry for my upcoming game and I'm specifically trying to see if it can help me track down crashes in my exported app. I followed the guide on getting set up and have also uploaded debug symbols: https://docs.sentry.io/platforms/godot/configuration/stack-traces/

To test, I triggered a div-by-0 error on purpose to see if I can see the stack trace. Sentry is able to log the div-by-0 crash but the stack track seems to be from the engine code (I included a screenshot). Is this a limitation or am I missing something?

Thanks!

topaz birch
#

What is the message property of a SentryEvent used for? Can I grab the stacktrace in _before_send and write it to message?

eg:

func _before_send(event: SentryEvent) -> SentryEvent:
if event.is_crash():
event.message = str(get_stack())
return event

topaz birch
#

ended up using set_context instead

eternal forge
#

event.message will be the option to get the message. note that it is different from error.value. we recommend always check if the property exists.

#

as for the event information, is the stack trace you see not the one you expected from your app?

topaz birch
#

hey sorry for the late reply, the stack trace (in the screenshot) isnt helpful, it looks like its part of the engine code.

I caused a div-by-0 on purpose in gdscript and was hoping that the default stack trace was going to help pinpoint where it was in gdscript itself. I ended up using the above solution to get a more useful stacktrace

devout turret
#

@topaz birch When I tested a divide by zero, Sentry did give me the full GDScript trace with exact line numbers (from the editor and android at least, not sure about iOS).

Were you by chance able to get the _before_send working? When I ran it from editor the event.message was empty here, which isn't very useful. And when I tested on iOS the function didn't even seem to be called.

topaz birch
#

Hmm, so for more context, the screenshot i provided was an exported windows build.

I didn't try iOS. event.message was also empty for me which is why I asked if I could piggyback off of it.

wraith sluice
#

Calling for @unique bolt to help us out here! It makes sense to me that there are engine frames in the stack trace, but the connection to the GDScript calling this seems lost

devout turret
#

this was running on android debug build. but perhaps there is a problem on windows