-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add better jni error reporting inside the godot editor #627
Conversation
There is a partial conflict with my new PR. |
Ok for me. I'll just wait with this PR until yours is merged and then fix and rebase |
src/jni/env.cpp
Outdated
void Env::exception_describe() { | ||
String Env::exception_describe() { | ||
#ifdef DEBUG_ENABLED | ||
jthrowable e = env->ExceptionOccurred(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplification: define it in following if
src/jni/env.cpp
Outdated
#ifdef DEBUG_ENABLED | ||
jthrowable e = env->ExceptionOccurred(); | ||
|
||
if (e != nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ptr != nullptr)
is redundant
This improves the jni error reporting inside the godot editor by grabbing the stacktrace from the jvm and printing them using the godot print commands. Only applies to tool mode. In all other cases, we still print the error using the jni provided method which just prints to the console.