summaryrefslogtreecommitdiffstats
path: root/src/debputy/exceptions.py
blob: a4459971319505f6bf1b78b5d32ddeb076fe361d (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from typing import cast, TYPE_CHECKING

if TYPE_CHECKING:
    from debputy.plugin.api.impl_types import DebputyPluginMetadata


class DebputyRuntimeError(RuntimeError):
    @property
    def message(self) -> str:
        return cast("str", self.args[0])


class DebputySubstitutionError(DebputyRuntimeError):
    pass


class DebputyManifestVariableRequiresDebianDirError(DebputySubstitutionError):
    pass


class DebputyDpkgGensymbolsError(DebputyRuntimeError):
    pass


class SymlinkLoopError(ValueError):
    @property
    def message(self) -> str:
        return cast("str", self.args[0])


class PureVirtualPathError(TypeError):
    @property
    def message(self) -> str:
        return cast("str", self.args[0])


class TestPathWithNonExistentFSPathError(TypeError):
    @property
    def message(self) -> str:
        return cast("str", self.args[0])


class DebputyFSError(DebputyRuntimeError):
    pass


class DebputyFSIsROError(DebputyFSError):
    pass


class PluginBaseError(DebputyRuntimeError):
    pass


class DebputyPluginRuntimeError(PluginBaseError):
    pass


class PluginNotFoundError(PluginBaseError):
    pass


class PluginInitializationError(PluginBaseError):
    pass


class PluginMetadataError(PluginBaseError):
    pass


class PluginConflictError(PluginBaseError):
    @property
    def plugin_a(self) -> "DebputyPluginMetadata":
        return cast("DebputyPluginMetadata", self.args[1])

    @property
    def plugin_b(self) -> "DebputyPluginMetadata":
        return cast("DebputyPluginMetadata", self.args[2])


class PluginAPIViolationError(PluginBaseError):
    pass


class UnhandledOrUnexpectedErrorFromPluginError(PluginBaseError):
    pass


class DebputyMetadataAccessError(DebputyPluginRuntimeError):
    pass