diff --git a/src/basic_api.cc b/src/basic_api.cc index 6be089b..b79a007 100644 --- a/src/basic_api.cc +++ b/src/basic_api.cc @@ -59,8 +59,13 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_myself( PEP_SESSION session = (PEP_SESSION) callLongMethod(env, obj, "getHandle"); pEp_identity *_ident = to_identity(env, ident); - ::myself(session, _ident); + PEP_STATUS status = ::myself(session, _ident); + if (status != PEP_STATUS_OK) { + LOGD("Failed Myself: 0x%04x\\n", status); + throw_pEp_Exception(env, status); + return NULL; + } return from_identity(env, _ident); } @@ -89,7 +94,13 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_setOwnKey( pEp_identity *_ident = to_identity(env, ident); char *_fpr = to_string(env, fpr); - ::set_own_key(session, _ident, _fpr); + PEP_STATUS status = ::set_own_key(session, _ident, _fpr); + + if (status != PEP_STATUS_OK) { + LOGD("Failed setOwnKey: 0x%04x\\n", status); + throw_pEp_Exception(env, status); + return NULL; + } return from_identity(env, _ident); }