forked from selfuryon/netdev
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexceptions.py
More file actions
28 lines (21 loc) · 923 Bytes
/
exceptions.py
File metadata and controls
28 lines (21 loc) · 923 Bytes
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
class DisconnectError(Exception):
"""AsyncSSH Disconnect Error with ip address"""
def __init__(self, ip_address, code, reason):
self.ip_address = ip_address
self.code = code
self.reason = reason
self.msg = "Host {} Disconnect Error: {}".format(ip_address, reason)
super().__init__(self.msg)
class TimeoutError(Exception):
"""concurrent.futures._base.TimeoutError with ip address"""
def __init__(self, ip_address):
self.ip_address = ip_address
self.msg = "Host {} Timeout Error".format(ip_address)
super().__init__(self.msg)
class CommitError(Exception):
"""concurrent.futures._base.TimeoutError with ip address"""
def __init__(self, ip_address, reason):
self.ip_address = ip_address
self.reason = reason
self.msg = "Host {} Commit Error: {}".format(ip_address, reason)
super().__init__(self.msg)