Coverage for src/debputy/exceptions.py: 92%
50 statements
« prev ^ index » next coverage.py v7.2.7, created at 2024-04-07 12:14 +0200
« prev ^ index » next coverage.py v7.2.7, created at 2024-04-07 12:14 +0200
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 DebputySubstitutionError(DebputyRuntimeError):
14 pass
17class DebputyManifestVariableRequiresDebianDirError(DebputySubstitutionError):
18 pass
21class DebputyDpkgGensymbolsError(DebputyRuntimeError):
22 pass
25class SymlinkLoopError(ValueError):
26 @property
27 def message(self) -> str:
28 return cast("str", self.args[0])
31class PureVirtualPathError(TypeError):
32 @property
33 def message(self) -> str:
34 return cast("str", self.args[0])
37class TestPathWithNonExistentFSPathError(TypeError):
38 @property
39 def message(self) -> str:
40 return cast("str", self.args[0])
43class DebputyFSError(DebputyRuntimeError):
44 pass
47class DebputyFSIsROError(DebputyFSError):
48 pass
51class PluginBaseError(DebputyRuntimeError):
52 pass
55class DebputyPluginRuntimeError(PluginBaseError):
56 pass
59class PluginNotFoundError(PluginBaseError):
60 pass
63class PluginInitializationError(PluginBaseError):
64 pass
67class PluginMetadataError(PluginBaseError):
68 pass
71class PluginConflictError(PluginBaseError):
72 @property
73 def plugin_a(self) -> "DebputyPluginMetadata":
74 return cast("DebputyPluginMetadata", self.args[1])
76 @property
77 def plugin_b(self) -> "DebputyPluginMetadata":
78 return cast("DebputyPluginMetadata", self.args[2])
81class PluginAPIViolationError(PluginBaseError):
82 pass
85class UnhandledOrUnexpectedErrorFromPluginError(PluginBaseError):
86 pass
89class DebputyMetadataAccessError(DebputyPluginRuntimeError):
90 pass