Skip to content

Commit 6d0d486

Browse files
committed
fix
1 parent 469cb6a commit 6d0d486

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cli/src/meta.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <odr/internal/util/odr_meta_util.hpp>
44

5+
#include <odr/exceptions.hpp>
6+
57
#include <iostream>
68
#include <string>
79

@@ -19,7 +21,9 @@ int main(int argc, char **argv) {
1921
DocumentFile document_file{input};
2022

2123
if (document_file.password_encrypted() && has_password) {
22-
if (!document_file.decrypt(password)) {
24+
try {
25+
document_file = document_file.decrypt(password).document_file();
26+
} catch (const WrongPasswordError &) {
2327
std::cerr << "wrong password" << std::endl;
2428
return 1;
2529
}

0 commit comments

Comments
 (0)