From 36fa39534155e744713dbffaacb649e4242b0658 Mon Sep 17 00:00:00 2001 From: Hussein Kasem Date: Thu, 12 Dec 2019 17:38:16 +0100 Subject: [PATCH] Print Exceptions from JNI side on messageToSend --- src/foundation_pEp_jniadapter_AbstractEngine.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/foundation_pEp_jniadapter_AbstractEngine.cc b/src/foundation_pEp_jniadapter_AbstractEngine.cc index 27efd72..2b61d19 100644 --- a/src/foundation_pEp_jniadapter_AbstractEngine.cc +++ b/src/foundation_pEp_jniadapter_AbstractEngine.cc @@ -120,10 +120,12 @@ namespace pEp { PEP_STATUS status = (PEP_STATUS) o.env()->CallIntMethod(obj, messageToSendMethodID, msg_); if (o.env()->ExceptionCheck()) { + o.env()->ExceptionDescribe(); status = PEP_UNKNOWN_ERROR; o.env()->ExceptionClear(); } + return status; } @@ -329,6 +331,7 @@ extern "C" { } catch (RuntimeError& ex) { throw_pEp_Exception(env, ex.status); + jvm->DetachCurrentThread(); return; } }