-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathexception.py
34 lines (19 loc) · 939 Bytes
/
exception.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
"""Exceptions for release script"""
from subprocess import CalledProcessError
class InputException(Exception):
"""Exception raised for invalid input."""
class ReleaseException(Exception):
"""Exception raised for a command error due to some release status"""
class DependencyException(Exception):
"""Error if dependency is missing"""
class UpdateVersionException(Exception):
"""Error if the old version is invalid or cannot be found, or if there's a duplicate version"""
class VersionMismatchException(Exception):
"""Error if the version is unexpected"""
class StatusException(Exception):
"""Error if something happened when calculating the status"""
class AsyncCalledProcessError(CalledProcessError):
"""Extend CalledProcessError to print the stdout as well"""
def __str__(self):
super_str = super().__str__()
return f"{super_str}. stdout={self.stdout}, stderr={self.stderr}"