-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Explanation
- Would be good to have clearer distinction of some well defined errors (that we want to detect) from the generic
PdfReadError:WrongPasswordErrorFileNotDecryptedErrorEmptyFileError
- This makes it cleaner for error catching and handling (instead of inspecting the args within the error message)
Code Example
from PyPDF2 import PdfReader, PdfWriter
from PyPDF2.errors import FileNotDecryptedError
filepath = "encrypted.pdf"
try:
PdfReader(filepath)
except FileNotDecryptedError:
# do something...specifically for this error!
# and not have to dig through the args of the error to pick out this specific error...Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels