Coverage for src/debputy/exceptions.py: 93%
56 statements
« prev ^ index » next coverage.py v7.6.0, created at 2025-01-27 13:59 +0000
« prev ^ index » next coverage.py v7.6.0, created at 2025-01-27 13:59 +0000
1from typing import cast, TYPE_CHECKING
3if TYPE_CHECKING:
4 from debputy.plugin.api.impl_types import DebputyPluginMetadata
7class DebputyRuntimeError(RuntimeError):
8 @property
9 def message(self) -> str:
10 return cast("str", self.args[0])
13class DebputyRuntimeErrorWithPreamble(DebputyRuntimeError):
15 def render_preamble(self) -> None:
16 raise NotImplementedError
19class DebputyBuildStepError(DebputyRuntimeError):
20 pass
23class DebputySubstitutionError(DebputyRuntimeError):
24 pass
27class DebputyManifestVariableRequiresDebianDirError(DebputySubstitutionError):
28 pass
31class DebputyDpkgGensymbolsError(DebputyRuntimeError):
32 pass
35class SymlinkLoopError(ValueError):
36 @property
37 def message(self) -> str:
38 return cast("str", self.args[0])
41class PureVirtualPathError(TypeError):
42 @property
43 def message(self) -> str:
44 return cast("str", self.args[0])
47class TestPathWithNonExistentFSPathError(TypeError):
48 @property
49 def message(self) -> str:
50 return cast("str", self.args[0])
53class DebputyFSError(DebputyRuntimeError):
54 pass
57class DebputyFSIsROError(DebputyFSError):
58 pass
61class PluginBaseError(DebputyRuntimeError):
62 pass
65class DebputyPluginRuntimeError(PluginBaseError):
66 pass
69class PluginNotFoundError(PluginBaseError):
70 pass
73class PluginInitializationError(PluginBaseError):
74 pass
77class PluginIncorrectRegistrationError(PluginInitializationError):
78 pass
81class PluginMetadataError(PluginBaseError):
82 pass
85class PluginConflictError(PluginBaseError):
86 @property
87 def plugin_a(self) -> "DebputyPluginMetadata":
88 return cast("DebputyPluginMetadata", self.args[1])
90 @property
91 def plugin_b(self) -> "DebputyPluginMetadata":
92 return cast("DebputyPluginMetadata", self.args[2])
95class PluginAPIViolationError(PluginBaseError):
96 pass
99class UnhandledOrUnexpectedErrorFromPluginError(PluginBaseError):
100 pass
103class DebputyMetadataAccessError(DebputyPluginRuntimeError):
104 pass