mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #565] librespot panics! when authentication fails #363
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#363
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xou816 on GitHub (Jan 18, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/565
When authentication fails (bad credentials, non-premium account, etc), librespot panics! instead of returning a proper Result::Err.
I see authenticate and Session::connect both return a io::Error instead of a custom result/error type. Is that intentional? If not, would you be open to a PR introducing a dedicated error type? (I suppose this would require some discussion in terms of implementation and potentially breaking changes).
(by the way, thank you very much for the outstanding work involved in this project!)
@xou816 commented on GitHub (Jan 18, 2021):
...I realize it's been discussed before, in particular here : https://github.com/librespot-org/librespot/issues/108#issuecomment-363019493
I can somewhat understand the rationale behind panicking for non premium account, but what about bad credentials? Are you still open to discussion on that point?
@ashthespy commented on GitHub (Jan 18, 2021):
I dabbled a little with improving the error handling by converting to
thiserrorand the binary toanyhow. But didn't find the time to finish it up and open a PR..It would be great if you want to give it a shot! :-)
@xou816 commented on GitHub (Jan 18, 2021):
Great, I'll have a look and see if I can figure something out :) thank you!
@xou816 commented on GitHub (Jan 22, 2021):
Hi @ashthespy, I opened a PR if you want to have a look! I went with
error-chainsince it was already part of the dependencies, I hope that's fine?