Unhandled Error Gdscript after release

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Megasoft78
:warning: Old Version Published before Godot 3 was released.

Hi,
I’m working on a little word game using Godot 2.1.4.
I’m planning to release it to Android and iOS.
I did release other games using other game engines (libgdx and Unity) and I always catch the unexpected errors and send them to my server with the stack trace to be able to analyze them and fix the issues as quick as possible.
In Java (libgdx) and in c# (Unity) I have a central way to catch unhandled exception and send the stack trace with a http request to my server.
How can I do a similar thing in Gdscript? I know Gdscript doesn’t support exception. Would be possible to create a module that attach to Gdscript error log and send back a signal to Gdscript when and error occur so I can send it to my server?
It’s quite critical for me because it’s impossible to write a game bug free and even with a lot of testing I’m sure users will experience issues.
Any idea on how to solve this problem?

:bust_in_silhouette: Reply From: rolfpancake

[!] I can only talk about Godot 3! Not sure if this is possible in Godot 2.

This is a good idea! My steps to tackle this would be:

1. Activate File Logging in project settings

activate file logging

2. Run your project and gather some errors

collect some errors

3. At each startup of your game look into the games data folder for a logfile

And if it contains words like “ERROR” or “SCRIPT ERROR” you can do your stuff (e.g. asking the user to send a bug-report including the logfile).

For example on Windows the path is like this:
%appdata%\Godot\app_userdata\GAMENAME\logs (but this depends on your system and Log Path setting)

And in my sample it contains this text:

OpenGL ES 3.0 Renderer: GeForce GT 555M/PCIe/SSE2 GLES3: max ubo light: 409 GLES3: max ubo reflections: 455, ubo size: 144 ARVR: Registered interface: Native mobile
**ERROR**: Condition ' p_width <= 0 || p_width > 16384 ' is true.    At: drivers\gles3\rasterizer_storage_gles3.cpp:1016:RasterizerStorageGLES3::texture_set_size_override()
- Condition ' p_width <= 0 || p_width > 16384 ' is true. Ready!
**ERROR**: No loader found for resource: res://imag2e.png    At: core\io\resource_loader.cpp:185:ResourceLoader::_load() - Method/Function Failed, returning: RES()
**SCRIPT ERROR**: Invalid operands 'int' and 'String' in operator '+'.    At: res://world.gdc:13:_on_divide_zero_button_up() - Invalid operands 'int' and 'String' in operator '+'.

Download the sample project:
http://www25.zippyshare.com/v/upWSmoNB/file.html

This is really good idea but unfortunatelly that project setting is not available in Godot 2.1.4. :frowning:
Anyway you give me an idea on how I can change the Godot source code. I can just write a log to a file and read from it in GDScript.

Thank you! :slight_smile:

Megasoft78 | 2018-01-08 06:34