Skip to content

Commit 8f97139

Browse files
committed
clarify error messages
1 parent 63bc320 commit 8f97139

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

msoffcrypto/format/ooxml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def decrypt(self, outfile, verify_integrity=False):
253253
... officefile.load_key("1234")
254254
... officefile.decrypt(outfile)
255255
Traceback (most recent call last):
256-
msoffcrypto.exceptions.DecryptionError: Unencrypted document
256+
msoffcrypto.exceptions.DecryptionError: Document is not encrypted
257257
"""
258258
if self.type == "agile":
259259
with self.file.openstream("EncryptedPackage") as stream:
@@ -284,7 +284,7 @@ def decrypt(self, outfile, verify_integrity=False):
284284
obuf = ECMA376Standard.decrypt(self.secret_key, stream)
285285
outfile.write(obuf)
286286
elif self.type == "plain":
287-
raise exceptions.DecryptionError("Unencrypted document")
287+
raise exceptions.DecryptionError("Document is not encrypted")
288288
else:
289289
raise exceptions.DecryptionError("Unsupported encryption method")
290290

0 commit comments

Comments
 (0)