How to get a call stack when a tool script fails?

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

I am making an editor plugin, and some errors are really hard to find out, such as one printing 1000 times in the console because of a loop everytime I use Ctrl+S. While it is clearly a mistake I made in my script, it is a PITA to find where it comes from. Is there any way to get the call stack of those errors?

:bust_in_silhouette: Reply From: MaaaxiKing

Wow, much time has passed since you asked. Do you now know how to access the call stack?

Nope. Eventually using the command line debugger. But sometimes even the GDScript debugger doesn’t catch anything and the only way is to compile Godot in debug and put a C++ breakpoint into the error callback.

Zylann | 2021-01-25 15:52