/
exceptions.py
54 lines (33 loc) · 1.06 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
class UraniumException(Exception):
pass
class ExitCodeException(UraniumException):
"""
use this to return a particular status code.
exceptions work much better for bailout cases,
so rely on that behaviour to handle non-zero status codes.
"""
def __init__(self, source, code):
self.source = source
self.code = code
super(ExitCodeException, self).__init__("")
def __str__(self):
return "{0} returned exit code {1}".format(self.source, self.code)
class CacheException(UraniumException):
""" exception with the cache object """
pass
class HistoryException(UraniumException):
pass
class HooksException(UraniumException):
pass
class PluginException(UraniumException):
""" an exception that occurred with the plugin """
pass
class ScriptException(UraniumException):
pass
class ConfigException(ScriptException):
pass
class NonZeroExitCodeException(ScriptException):
pass
class PackageException(UraniumException):
""" exceptions with the package object """
pass