Skip to content

Commit 7bef3ea

Browse files
authored
Merge pull request #61 from klodr/fix/decrypt-catch-context
fix(decrypt): surface exception context in catch blocks
2 parents ddf4b6a + 627f485 commit 7bef3ea

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/encrypt_decrypt/encrypt_decrypt.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,9 @@ Napi::Value MultiEncryptWrapper::decryptForCommunity(const Napi::CallbackInfo& i
644644
log::warning(
645645
cat,
646646
"decryptForCommunity: Failed to decrypt "
647-
"message at index {}",
648-
i);
647+
"message at index {}: {}",
648+
i,
649+
e.what());
649650
}
650651
}
651652

@@ -732,8 +733,9 @@ Napi::Value MultiEncryptWrapper::decryptFor1o1(const Napi::CallbackInfo& info) {
732733
log::warning(
733734
cat,
734735
"decryptFor1o1: Failed to decrypt "
735-
"message at index {}",
736-
i);
736+
"message at index {}: {}",
737+
i,
738+
e.what());
737739
}
738740
}
739741

@@ -797,7 +799,7 @@ Napi::Value MultiEncryptWrapper::decryptForGroup(const Napi::CallbackInfo& info)
797799
extractGroupEncKeys(second, "decryptForGroup.second.groupEncKeys");
798800

799801
std::vector<std::span<const unsigned char>> span_group_enc_keys;
800-
span_group_enc_keys.reserve(span_group_enc_keys.size());
802+
span_group_enc_keys.reserve(groupEncKeysVec.size());
801803
for (const auto& inner : groupEncKeysVec) {
802804
span_group_enc_keys.emplace_back(inner);
803805
}
@@ -833,8 +835,9 @@ Napi::Value MultiEncryptWrapper::decryptForGroup(const Napi::CallbackInfo& info)
833835
log::warning(
834836
cat,
835837
"decryptForGroup: Failed to decrypt "
836-
"message at index {}",
837-
i);
838+
"message at index {}: {}",
839+
i,
840+
e.what());
838841
}
839842
}
840843

0 commit comments

Comments
 (0)