This commit is contained in:
@@ -1414,14 +1414,10 @@ class Session(Closeable, MessageListener, SubListener):
|
||||
failed.ParseFromString(payload)
|
||||
raise RuntimeError(failed)
|
||||
except socket.timeout:
|
||||
# Normal path: server did not send an error APResponse.
|
||||
pass
|
||||
finally:
|
||||
self.connection.set_timeout(0)
|
||||
|
||||
# If we reach here, the handshake succeeded; derive
|
||||
# the Shannon cipher keys and mark the session as
|
||||
# connected.
|
||||
buffer.seek(20)
|
||||
with self.__auth_lock:
|
||||
self.cipher_pair = CipherPair(
|
||||
@@ -1470,10 +1466,6 @@ class Session(Closeable, MessageListener, SubListener):
|
||||
)
|
||||
time.sleep(1)
|
||||
|
||||
# All attempts failed: log a clear, user-friendly error and
|
||||
# terminate the process without a traceback. This prevents
|
||||
# callers (like Zotify) from incorrectly retrying OAuth when
|
||||
# the failure is purely network-related.
|
||||
friendly_message = (
|
||||
"Failed to connect to Spotify after "
|
||||
f"{max_attempts} attempts. "
|
||||
@@ -1482,8 +1474,6 @@ class Session(Closeable, MessageListener, SubListener):
|
||||
"This is usually a network or firewall issue."
|
||||
)
|
||||
self.logger.error("%s Last error: %s", friendly_message, last_exc)
|
||||
# Exit with a non-zero status but no stack trace; the
|
||||
# logger message above provides the user-facing explanation.
|
||||
raise SystemExit(1)
|
||||
|
||||
def content_feeder(self) -> PlayableContentFeeder:
|
||||
|
||||
Reference in New Issue
Block a user