Total Complexity | 1 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | """Shared exceptions.""" |
||
2 | |||
3 | |||
4 | 1 | class InvalidConfig(ValueError): |
|
5 | """Raised when the config file is invalid.""" |
||
6 | |||
7 | |||
8 | 1 | class ShellError(RuntimeError): |
|
9 | """Raised when a shell call has a non-zero return code.""" |
||
10 | |||
11 | 1 | def __init__(self, *args, **kwargs): |
|
12 | 1 | self.program = kwargs.pop('program', None) |
|
13 | 1 | self.output = kwargs.pop('output', None) |
|
14 | 1 | super().__init__(*args, **kwargs) # type: ignore |
|
15 | |||
16 | |||
17 | 1 | class InvalidRepository(RuntimeError): |
|
18 | """Raised when there is a problem with the checked out directory.""" |
||
19 | |||
20 | |||
21 | 1 | class UncommittedChanges(RuntimeError): |
|
22 | """Raised when uncommitted changes are not expected.""" |
||
23 | |||
24 | |||
25 | 1 | class ScriptFailure(ShellError): |
|
26 | """Raised when post-install script has a non-zero exit code.""" |
||
27 |