Catch OSError when authorizing connection

Fixes Sentry issue CURA-1GW.
This commit is contained in:
Ghostkeeper 2021-01-19 11:05:55 +01:00
parent 888abdac33
commit 640e038ce7
No known key found for this signature in database
GPG key ID: 14C3586CD2EFC5B9

View file

@ -69,7 +69,9 @@ class AuthorizationHelpers:
try:
return self.parseTokenResponse(requests.post(self._token_url, data = data)) # type: ignore
except requests.exceptions.ConnectionError:
return AuthenticationResponse(success=False, err_message="Unable to connect to remote server")
return AuthenticationResponse(success = False, err_message = "Unable to connect to remote server")
except OSError as e:
return AuthenticationResponse(success = False, err_message = "Operating system is unable to set up a secure connection: {err}".format(err = str(e)))
@staticmethod
def parseTokenResponse(token_response: requests.models.Response) -> "AuthenticationResponse":