How to get errors within open script

Godot Version

Any / Godot 4

Question

I am trying to get the errors and warnings in the script editor. I’m sure that there is some brute force way to get the node which contains the errors, but this is really not what I want to have to do.

Is there maybe a cool method for this or some easier way to get the errors, or maybe to detect when errors occur while writing code so that I don’t need to check for errors every second?

You could set warnings to errors in the project settings. With static typing you can catch more errors without running the game, but some errors are only possible to catch by testing the program, logical errors and/or complex memory-bound ones.

1 Like

I am aware that static typing can help catch errors, similar to how the rust compiler notices when incorrect types are used.

However, I want to get the errors right in the editor, not catch them in-game.

I am building a plugin, should probably have said that in the title…

Maybe you want to look into a unit testing framework?

Plugins will produce errors to the editor’s output panel. Plugins also use the same scripting language so most errors will be found when running the plugin. Static analysis only goes so far.

1 Like

Again, I was not specific enough…
I want to get the errors WITH the plugin, not for the plugin.
I have already checked most of my code using unit test, I have the intention of getting the errors of a currently open script, so that the plugin can do something with it, like potentially parsing it or doing an automated lookup on what might be wrong.