Commit a251d736 authored by johan's avatar johan

Bctoolbox exception management updated

parent 35c220d1
......@@ -563,7 +563,7 @@ namespace lime {
decryptStatus = DRSession->ratchetDecrypt(DRmessage, AD, randomSeed, payloadDirectEncryption);
}
} catch (BctbxException &e) { // any bctbx Exception is just considered as decryption failed (it shall occurs in case of maximum skipped keys reached or inconsistency ib the direct Encryption flag)
LIME_LOGW<<"Double Ratchet session failed to decrypt message and raised an exception saying : "<<e.what();
LIME_LOGW<<"Double Ratchet session failed to decrypt message and raised an exception saying : "<<e;
decryptStatus = false; // lets keep trying with other sessions if provided
}
......
......@@ -480,6 +480,8 @@ long int Db::check_peerDevice(const std::string &peerDeviceId, const DSA<Curve,
} else { // not found in local Storage: return 0
return 0;
}
} catch (BctbxException const &e) {
throw BCTBX_EXCEPTION << "Peer device "<<peerDeviceId<<" check failed: "<<e.str();
} catch (exception const &e) {
throw BCTBX_EXCEPTION << "Peer device "<<peerDeviceId<<" check failed: "<<e.what();
}
......
......@@ -763,7 +763,7 @@ namespace lime {
// when message stop crossing themselves on the network
X3DH_init_sender_session(peersBundle);
} catch (BctbxException &e) { // something went wrong, go for callback as this function may be called by code not supporting exceptions
if (callback) callback(lime::CallbackReturn::fail, std::string{"Error during the peer Bundle processing : "}.append(e.what()));
if (callback) callback(lime::CallbackReturn::fail, std::string{"Error during the peer Bundle processing : "}.append(e.str()));
cleanUserData(userData);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment