Fix connect login 2 (#128)

This commit is contained in:
Otto Winter 2021-10-21 19:24:03 +02:00 committed by GitHub
parent 3b8b2d9d66
commit ca3a14b1bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,10 +172,10 @@ class APIClient:
try:
await self._connection.connect(login=login)
except APIConnectionError:
await _on_stop()
self._connection = None
raise
except Exception as e:
await _on_stop()
self._connection = None
raise APIConnectionError(
f"Unexpected error while connecting to {self._log_name}: {e}"
) from e