godot-cpp
godot-cpp copied to clipboard
Throw exception in GDNative cause game stop without message
With a simple throw std::exception the game stop without printing the message from the exception.
Godot is not compiled with exceptions enabled, so I think this is expected behavior. Use the error macros at your disposal instead, such as ERR_FAIL_*(). You can return values of the Error enum to use as error codes.
So I can't make the program stop. Print an error message is all I can do.
Just use get_tree()->quit(1); after ERR_ macro
There's also the CRASH_NOW() macro you can use.