File: errors.py

package info (click to toggle)
pypdf2 2.12.1-3%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,144 kB
  • sloc: python: 28,767; makefile: 119; sh: 2
file content (48 lines) | stat: -rw-r--r-- 683 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
All errors/exceptions PyPDF2 raises and all of the warnings it uses.

Please note that broken PDF files might cause other Exceptions.
"""


class DependencyError(Exception):
    pass


class PyPdfError(Exception):
    pass


class PdfReadError(PyPdfError):
    pass


class PageSizeNotDefinedError(PyPdfError):
    pass


class PdfReadWarning(UserWarning):
    pass


class PdfStreamError(PdfReadError):
    pass


class ParseError(Exception):
    pass


class FileNotDecryptedError(PdfReadError):
    pass


class WrongPasswordError(FileNotDecryptedError):
    pass


class EmptyFileError(PdfReadError):
    pass


STREAM_TRUNCATED_PREMATURELY = "Stream has ended unexpectedly"