This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 300
/
zdd_exceptions.py
81 lines (67 loc) · 2.66 KB
/
zdd_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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
""" Exit Status 1 is already used in the script.
Zdd returns with exit status 1 when app is not force
deleted either through argument or through prompt.
Exit Status 2 is used for Unknown Exceptions.
"""
class InvalidArgException(Exception):
""" This exception indicates invalid combination of arguments
passed to zdd"""
def __init__(self, msg):
super(InvalidArgException, self).__init__(msg)
self.error = msg
self.zdd_exit_status = 3
class MissingFieldException(Exception):
""" This exception indicates required fields which are missing
in JSON payload passed to zdd"""
def __init__(self, msg, field):
super(MissingFieldException, self).__init__(msg)
self.error = msg
self.missing_field = field
self.zdd_exit_status = 4
class MarathonLbEndpointException(Exception):
""" This excaption indicates issue with one of the marathonlb
endpoints specified as argument to Zdd"""
def __init__(self, msg, url, error):
super(MarathonLbEndpointException, self).__init__(msg)
self.msg = msg
self.url = url
self.error = error
self.zdd_exit_status = 5
class MarathonEndpointException(Exception):
""" This excaption indicates issue with marathon endpoint
specified as argument to Zdd"""
def __init__(self, msg, url, error):
super(MarathonEndpointException, self).__init__(msg)
self.msg = msg
self.url = url
self.error = error
self.zdd_exit_status = 6
class AppCreateException(Exception):
""" This exception indicates there was a error while creating the
new App and hence it was not created."""
def __init__(self, msg, url, payload, error):
super(AppCreateException, self).__init__(msg)
self.msg = msg
self.error = error
self.url = url
self.payload = payload
self.zdd_exit_status = 7
class AppDeleteException(Exception):
""" This exception indicates there was a error while deleting the
old App and hence it was not deleted """
def __init__(self, msg, url, appid, error):
super(AppDeleteException, self).__init__(msg)
self.msg = msg
self.error = error
self.url = url
self.zdd_exit_status = 8
class AppScaleException(Exception):
""" This exception indicated there was a error while either scaling up
new app or while scaling down old app"""
def __init__(self, msg, url, payload, error):
super(AppScaleException, self).__init__(msg)
self.msg = msg
self.error = error
self.url = url
self.payload = payload
self.zdd_exit_status = 9