MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / SSHTunnelConnectionLost

Class SSHTunnelConnectionLost

web/pgadmin/utils/exception.py:55–84  ·  view source on GitHub ↗

Exception when connection to SSH tunnel is lost

Source from the content-addressed store, hash-verified

53
54
55class SSHTunnelConnectionLost(HTTPException):
56 """
57 Exception when connection to SSH tunnel is lost
58 """
59
60 def __init__(self, _tunnel_host):
61 self.tunnel_host = _tunnel_host
62 HTTPException.__init__(self)
63
64 @property
65 def name(self):
66 return HTTP_STATUS_CODES.get(503, SERVICE_UNAVAILABLE)
67
68 def get_response(self, environ=None, scope=None):
69 return service_unavailable(
70 _("Connection to the SSH Tunnel for host '{0}' has been lost. "
71 "Reconnect to the database server.").format(self.tunnel_host),
72 info="SSH_TUNNEL_CONNECTION_LOST",
73 data={
74 'tunnel_host': self.tunnel_host
75 }
76 )
77
78 def __str__(self):
79 return "Connection to the SSH Tunnel for host '{0}' has been lost. " \
80 "Reconnect to the database server".format(self.tunnel_host)
81
82 def __repr__(self):
83 return "Connection to the SSH Tunnel for host '{0}' has been lost. " \
84 "Reconnect to the database server".format(self.tunnel_host)
85
86
87class CryptKeyMissing(HTTPException):

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected