summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-01 14:42:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-07 07:12:39 +0100
commit8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 (patch)
treed41feeea533127280e0503d0dc2dd55a4ab83ce8 /javaunohelper
parent4f810905fa74128871f2fe924a3d28a79f4e4261 (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')
-rw-r--r--javaunohelper/Library_juhx.mk1
-rw-r--r--javaunohelper/source/bootstrap.cxx7
2 files changed, 6 insertions, 2 deletions
diff --git a/javaunohelper/Library_juhx.mk b/javaunohelper/Library_juhx.mk
index 1a24e5ef54f2..6eacff250c0f 100644
--- a/javaunohelper/Library_juhx.mk
+++ b/javaunohelper/Library_juhx.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_Library_use_libraries,juhx,\
jvmaccess \
sal \
salhelper \
+ tl \
))
$(eval $(call gb_Library_add_exception_objects,juhx,\
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() );