diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-01 14:42:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-07 07:12:39 +0100 |
commit | 8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 (patch) | |
tree | d41feeea533127280e0503d0dc2dd55a4ab83ce8 /javaunohelper/source/bootstrap.cxx | |
parent | 4f810905fa74128871f2fe924a3d28a79f4e4261 (diff) |
log nice exception messages whereever possible
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1
Reviewed-on: https://gerrit.libreoffice.org/68579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'javaunohelper/source/bootstrap.cxx')
-rw-r--r-- | javaunohelper/source/bootstrap.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx index cb927de74e9f..442dd00ef2c5 100644 --- a/javaunohelper/source/bootstrap.cxx +++ b/javaunohelper/source/bootstrap.cxx @@ -38,6 +38,7 @@ #include <jni.h> #include <jvmaccess/virtualmachine.hxx> #include <jvmaccess/unovirtualmachine.hxx> +#include <tools/diagnose_ex.h> #include "juhx-export-functions.hxx" #include "vm.hxx" @@ -148,10 +149,11 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap( } catch (const RuntimeException & exc) { + css::uno::Any exAny( cppu::getCaughtException() ); jclass c = jni_env->FindClass( "com/sun/star/uno/RuntimeException" ); if (nullptr != c) { - SAL_WARN("javaunohelper", "forwarding RuntimeException: " << exc ); + SAL_WARN("javaunohelper", "forwarding RuntimeException: " << exceptionToString(exAny) ); OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); jni_env->ThrowNew( c, cstr.getStr() ); @@ -159,10 +161,11 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap( } catch (const Exception & exc) { + css::uno::Any ex( cppu::getCaughtException() ); jclass c = jni_env->FindClass( "com/sun/star/uno/Exception" ); if (nullptr != c) { - SAL_WARN("javaunohelper", "forwarding Exception: " << exc ); + SAL_WARN("javaunohelper", "forwarding Exception: " << exceptionToString(ex) ); OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); jni_env->ThrowNew( c, cstr.getStr() ); |