返回 ppt-master
errors.py
1 #!/usr/bin/env python3
2 """
3 PPT Master - PPTX Shape Errors
4
5 Shared exception types for the DrawingML preset-geometry package.
6
7 Usage:
8 Import exception classes from pptx_shapes.errors.
9
10 Examples:
11 from pptx_shapes.errors import FormulaEvaluationError
12
13 Dependencies:
14 None (only uses standard library)
15 """
16
17
18 class PresetShapeError(ValueError):
19 """Base error for invalid preset-shape data or evaluation input."""
20
21
22 class PresetShapeDataError(PresetShapeError):
23 """Raised when the bundled preset catalog is incomplete or malformed."""
24
25
26 class FormulaSyntaxError(PresetShapeError):
27 """Raised when a DrawingML guide formula has invalid syntax."""
28
29
30 class FormulaEvaluationError(PresetShapeError):
31 """Raised when a syntactically valid formula cannot be evaluated."""
32
33
34 class UnknownGuideError(PresetShapeError):
35 """Raised when a formula references an unknown guide token."""
36
37
38 class UnknownPresetShapeError(KeyError):
39 """Raised when a preset name is absent from the locked shape catalog."""
40
40 lines PYTHON