MCPcopy Create free account
hub / github.com/Syncplay/syncplay / connectionLost

Method connectionLost

syncplay/protocols.py:98–119  ·  view source on GitHub ↗
(self, reason)

Source from the content-addressed store, hash-verified

96 self.sendHello()
97
98 def connectionLost(self, reason):
99 try:
100 if "Invalid DNS-ID" in str(reason.value):
101 self._client._serverSupportsTLS = False
102 elif "tlsv1 alert protocol version" in str(reason.value):
103 self._client._clientSupportsTLS = False
104 elif "certificate verify failed" in str(reason.value):
105 self.dropWithError(getMessage("startTLS-server-certificate-invalid"))
106 elif "mismatched_id=DNS_ID" in str(reason.value):
107 self.dropWithError(getMessage("startTLS-server-certificate-invalid-DNS-ID"))
108 elif reason:
109 try:
110 self._client.ui.showErrorMessage(str(type(reason)))
111 self._client.ui.showErrorMessage(str(reason))
112 if reason.stack:
113 self._client.ui.showErrorMessage(str(reason.stack))
114 self._client.ui.showErrorMessage(str(reason.value))
115 except:
116 pass
117 except:
118 pass
119 self._client.destroyProtocol()
120
121 def dropWithError(self, error):
122 self._client.ui.showErrorMessage(error)

Callers

nothing calls this directly

Calls 4

dropWithErrorMethod · 0.95
getMessageFunction · 0.90
destroyProtocolMethod · 0.80
showErrorMessageMethod · 0.45

Tested by

no test coverage detected