File size: 1,285 Bytes
9d60e8e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Safe, user-facing exception types for doc-inspector."""


class DocInspectorError(Exception):
    """Base class for expected application errors."""


class ConfigurationError(DocInspectorError):
    """Required environment configuration is missing or invalid."""


class DocumentInputError(DocInspectorError):
    """The supplied file cannot be accepted or decoded."""


class UnsupportedFileTypeError(DocumentInputError):
    """The file extension or decoded content is unsupported."""


class FileSizeLimitError(DocumentInputError):
    """The file exceeds the configured byte limit."""


class PageLimitError(DocumentInputError):
    """A PDF has more pages than the core extractor accepts."""


class EncryptedPdfError(DocumentInputError):
    """A PDF requires a password and cannot be processed."""


class DocumentDecodeError(DocumentInputError):
    """The document is corrupt, empty, or otherwise undecodable."""


class ProviderInvocationError(DocInspectorError):
    """The selected cloud model could not complete the request."""


class StructuredOutputError(DocInspectorError):
    """The provider response did not validate against the selected schema."""


class RequestLimitError(DocInspectorError):
    """The public deployment request budget has been exhausted."""