[GH-ISSUE #108] Authentication failure should not panic, but exit without panic and a proper error message #98

Closed
opened 2026-02-27 19:28:49 +03:00 by kerem · 5 comments
Owner

Originally created by @michaelherger on GitHub (Jan 30, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/108

Currently if authentication fails, librespot would panic

thread 'main' panicked at 'Authentication failed', /Users/mh/Dropbox/Squeezebox/git/spotty/target/debug/build/librespot-core-3ff3f374b034b2cc/out/lib.rs:388
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This is ugly, as it's not an unexpected failure, but a very valid and to be expected error state. The panic message leads to many users ignoring the actual message about the authentication failure.

See github.com/librespot-org/librespot@5f21c25828/core/src/connection/mod.rs (L70)

Originally created by @michaelherger on GitHub (Jan 30, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/108 Currently if authentication fails, librespot would panic ``` thread 'main' panicked at 'Authentication failed', /Users/mh/Dropbox/Squeezebox/git/spotty/target/debug/build/librespot-core-3ff3f374b034b2cc/out/lib.rs:388 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` This is ugly, as it's not an unexpected failure, but a very valid and to be expected error state. The panic message leads to many users ignoring the actual message about the authentication failure. See https://github.com/librespot-org/librespot/blob/5f21c2582887b6f58aeb4a0900c5c28ee634ef98/core/src/connection/mod.rs#L70
kerem 2026-02-27 19:28:49 +03:00
Author
Owner

@ComlOnline commented on GitHub (Jan 30, 2018):

This is very related to #52.
The error needs to tell us that auth failed or the user is using a free account.
I'll close that issue.

<!-- gh-comment-id:361540003 --> @ComlOnline commented on GitHub (Jan 30, 2018): This is very related to #52. The error needs to tell us that auth failed or the user is using a free account. I'll close that issue.
Author
Owner

@sashahilton00 commented on GitHub (Feb 5, 2018):

In light of the recent decision to try and separate librespot into the core library, and a more featureful easy to use daemon, I'm inclined to suggest that we leave this be, as panicking is the correct behaviour if an invalid/free account is used. What we could do is add an extra line to the output at an info level which tells people that either their password is bad, or they're using a free account. I'm not sure there is a way to distinguish between auth failed and free accounts, as typically the user would not see the option to use spotify connect when using a free account.

<!-- gh-comment-id:363019493 --> @sashahilton00 commented on GitHub (Feb 5, 2018): In light of the recent decision to try and separate librespot into the core library, and a more featureful easy to use daemon, I'm inclined to suggest that we leave this be, as panicking is the correct behaviour if an invalid/free account is used. What we could do is add an extra line to the output at an info level which tells people that either their password is bad, or they're using a free account. I'm not sure there is a way to distinguish between auth failed and free accounts, as typically the user would not see the option to use spotify connect when using a free account.
Author
Owner

@ComlOnline commented on GitHub (Feb 5, 2018):

As long as it says it could be either in a clear way, I'm sure they will figure it out. (I hope)

<!-- gh-comment-id:363198429 --> @ComlOnline commented on GitHub (Feb 5, 2018): As long as it says it could be either in a clear way, I'm sure they will figure it out. (I hope)
Author
Owner

@sashahilton00 commented on GitHub (Feb 10, 2018):

Have added an error message in PR referenced above. Please let me know if you're satisfied that it's informative enough, then will merge, corrections notwithstanding.

<!-- gh-comment-id:364702268 --> @sashahilton00 commented on GitHub (Feb 10, 2018): Have added an error message in PR referenced above. Please let me know if you're satisfied that it's informative enough, then will merge, corrections notwithstanding.
Author
Owner

@ComlOnline commented on GitHub (Feb 11, 2018):

Sorry I'm MIA, currently on holiday in Canada, Yeah That works great, Through from the sounds of it Paul thinks it may be possible to actually differentiate between auth failed and not premium. Either way good work!

<!-- gh-comment-id:364722215 --> @ComlOnline commented on GitHub (Feb 11, 2018): Sorry I'm MIA, currently on holiday in Canada, Yeah That works great, Through from the sounds of it Paul thinks it may be possible to actually differentiate between auth failed and not premium. Either way good work!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#98
No description provided.