spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

properly handle Session::connect() errors

Open eladyn opened this issue 3 years ago • 0 comments

Previously, a SessionError from the connection future was silently ignored and the application just continued to run (waiting for a potential connection from discovery).

Now, if the connection can't be established, the error is logged and the application shuts down. For example, if you provide a wrong password:

➜ target/release/spotifyd --no-daemon                 
Loading config from "/home/user/.config/spotifyd/spotifyd.conf"
No password specified. Checking password_cmd
Running "zenity --password" using "/usr/bin/zsh"
No proxy specified
Using software volume controller.
Connecting to AP "ap.spotify.com:443"
Failed to connect to spotify: Login failed with reason: Bad credentials

Before:

➜ target/release/spotifyd --no-daemon                   
Loading config from "/home/user/.config/spotifyd/spotifyd.conf"
No password specified. Checking password_cmd
Running "zenity --password" using "/usr/bin/zsh"
No proxy specified
Using software volume controller.
Connecting to AP "ap.spotify.com:443"
# application continues to run, there would not even be a hint about
# the failed authentication in the debug logs

fixes (maybe): #1040

eladyn avatar Jan 21 '22 16:01 eladyn