From ca0ec4043f20e2e2c687cdf83ca5df5608c1b066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Fri, 16 Aug 2013 11:31:26 +0200 Subject: JNI Convenience: Print exceptions in debug mode. The exception message might contain valuable information about what went wrong, so we should print the message. Change-Id: I50c986d4c18cf6115017fcc92363c946be45024d Reviewed-by: Yoann Lopes --- src/platformsupport/jniconvenience/qjniobject.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/platformsupport/jniconvenience/qjniobject.cpp b/src/platformsupport/jniconvenience/qjniobject.cpp index 1d0bb435aa..ecf247aabf 100644 --- a/src/platformsupport/jniconvenience/qjniobject.cpp +++ b/src/platformsupport/jniconvenience/qjniobject.cpp @@ -57,6 +57,9 @@ static jclass getCachedClass(JNIEnv *env, const char *className) jclass c = env->FindClass(className); if (env->ExceptionCheck()) { c = 0; +#ifdef QT_DEBUG + env->ExceptionDescribe(); +#endif // QT_DEBUG env->ExceptionClear(); } if (c) @@ -88,6 +91,9 @@ static jmethodID getCachedMethodID(JNIEnv *env, if (env->ExceptionCheck()) { id = 0; +#ifdef QT_DEBUG + env->ExceptionDescribe(); +#endif // QT_DEBUG env->ExceptionClear(); } @@ -117,6 +123,9 @@ static jfieldID getCachedFieldID(JNIEnv *env, if (env->ExceptionCheck()) { id = 0; +#ifdef QT_DEBUG + env->ExceptionDescribe(); +#endif // QT_DEBUG env->ExceptionClear(); } -- cgit v1.2.3