File size: 1,223 Bytes
1b4ed07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Copyright 2026 AutomatosX
# SPDX-License-Identifier: AGPL-3.0-only
# Modified 2026-10-17 for v1.2; prior component notices are in NOTICE.
"""Public error types. Messages stay content-free."""
from __future__ import annotations


class AXDocLayoutError(Exception):
    """Base error for the public contract."""


class InvalidPageImageError(AXDocLayoutError):
    """Page raster failed validation."""


class PdfRejectedError(AXDocLayoutError):
    """CLI and loaders reject PDF inputs."""


class UnsupportedBackendError(AXDocLayoutError):
    """Backend missing, unknown, or unavailable."""


class ArtifactError(AXDocLayoutError):
    """Artifact identity, digest, or files failed closed."""


class ArtifactUnavailableError(ArtifactError):
    """No published immutable artifact is available to load."""


class InvalidRevisionError(ArtifactError):
    """Hub revision is not a 40-character commit."""


class BackendUnavailableError(UnsupportedBackendError):
    """Requested inference backend is missing or unknown."""


class InferenceError(AXDocLayoutError):
    """A loaded backend could not execute page-raster inference."""


class TaxonomyError(AXDocLayoutError):
    """Unknown or reserved class identity."""