Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/pypdf/errors.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2All errors/exceptions pypdf raises and all of the warnings it uses.
4Please note that broken PDF files might cause other Exceptions.
5"""
8class DeprecationError(Exception):
9 """Raised when a deprecated feature is used."""
12class DependencyError(Exception):
13 """
14 Raised when a required dependency (a library or module that pypdf depends on)
15 is not available or cannot be imported.
16 """
19class PyPdfError(Exception):
20 """Base class for all exceptions raised by pypdf."""
23class PdfReadError(PyPdfError):
24 """Raised when there is an issue reading a PDF file."""
27class PageSizeNotDefinedError(PyPdfError):
28 """Raised when the page size of a PDF document is not defined."""
31class PdfReadWarning(UserWarning):
32 """Issued when there is a potential issue reading a PDF file, but it can still be read."""
35class PdfStreamError(PdfReadError):
36 """Raised when there is an issue reading the stream of data in a PDF file."""
39class ParseError(PyPdfError):
40 """
41 Raised when there is an issue parsing (analyzing and understanding the
42 structure and meaning of) a PDF file.
43 """
46class FileNotDecryptedError(PdfReadError):
47 """
48 Raised when a PDF file that has been encrypted
49 (meaning it requires a password to be accessed) has not been successfully
50 decrypted.
51 """
54class WrongPasswordError(FileNotDecryptedError):
55 """Raised when the wrong password is used to try to decrypt an encrypted PDF file."""
58class EmptyFileError(PdfReadError):
59 """Raised when a PDF file is empty or has no content."""
62class EmptyImageDataError(PyPdfError):
63 """Raised when trying to process an image that has no data."""
66STREAM_TRUNCATED_PREMATURELY = "Stream has ended unexpectedly"