/
exceptions.py
65 lines (41 loc) · 1.33 KB
/
exceptions.py
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
""" This file is licensed under GPLv3, see https://www.gnu.org/licenses/ """
from typing import TYPE_CHECKING, List, Optional
from .core import DataType
if TYPE_CHECKING:
# pylint: disable=unused-import
from .build import PackageBuild # noqa
from .version import VersionMatcher # noqa
from .core import InteractiveSpawn # noqa
class PackagesNotFoundInRepo(DataType, Exception):
packages: List[str]
wanted_by: str
class PackagesNotFoundInAUR(DataType, Exception):
packages: List[str]
wanted_by: str
class BuildError(Exception):
pass
class CloneError(DataType, Exception):
build: 'PackageBuild'
result: 'InteractiveSpawn'
class DependencyError(Exception):
pass
class DependencyVersionMismatch(DataType, Exception):
version_found: str
dependency_line: str
who_depends: str
depends_on: str
location: str
version_matcher: Optional['VersionMatcher'] = None
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.version_matcher:
self.dependency_line = self.version_matcher.line
class DependencyNotBuiltYet(Exception):
pass
class AURError(Exception):
pass
class SysExit(Exception):
code: int
def __init__(self, code: int) -> None:
self.code = code
super().__init__(f"Exit code: {code}")