Completed
Pull Request — develop (#148)
by Jace
09:15
created

ShellError   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 10
c 2
b 0
f 0
wmc 1

1 Method

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