-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathkatanaerrors.py
50 lines (28 loc) · 1.7 KB
/
katanaerrors.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
class WTFError(Exception):
pass
class ModuleNotFound(WTFError):
def __init__(self, module):
self.message = "Module not found: {}".format(module)
class NotImplemented(WTFError):
def __init__(self, name, provisioner):
self.message = "Function '{}' is not implemented for the provisioner {}.".format(name, provisioner)
def __init__(self, name, provisioner, module):
self.message = "Function '{}' is not implemented in the module '{}'.".format(name, module)
class MissingFunction(WTFError):
def __init__(self, func, task_type):
self.message = "Function '{}' is missing from the '{}' plugin.".format(func, task_type)
class MissingRequiredParam(WTFError):
def __init__(self, param, plugin_name):
self.message = "Plugin '{}' requires parameter '{}', but this parameter appears to be missing.".format(
plugin_name, param)
class UnrecognizedParamValue(WTFError):
def __init__(self, param, param_value, plugin_name, valid_values):
self.message = "Plugin '{}' was specified with {}={}, but this must be one of: {}".format(plugin_name, param,
param_value,
valid_values)
class CriticalFunctionFailure(WTFError):
def __init__(self, plugin_name, message="Unknown error"):
self.message = "Plugin '{}' suffered a critical failure: {}".format(plugin_name, message)
class BlockedByDependencyException(WTFError):
def __init__(self, dependency):
self.message = f"The status of the '{dependency}' dependency could not be determined."