[GH-ISSUE #565] librespot panics! when authentication fails #363

Closed
opened 2026-02-27 19:30:13 +03:00 by kerem · 4 comments
Owner

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!)

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!)
kerem closed this issue 2026-02-27 19:30:13 +03:00
Author
Owner

@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?

<!-- gh-comment-id:762141301 --> @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?
Author
Owner

@ashthespy commented on GitHub (Jan 18, 2021):

I dabbled a little with improving the error handling by converting to thiserror and the binary to anyhow. 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! :-)

<!-- gh-comment-id:762154170 --> @ashthespy commented on GitHub (Jan 18, 2021): I dabbled a little with improving the error handling by converting to [`thiserror`](https://docs.rs/thiserror/1.0.23/thiserror/) and the binary to [`anyhow`](https://docs.rs/anyhow/1.0.38/anyhow/). 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! :-)
Author
Owner

@xou816 commented on GitHub (Jan 18, 2021):

Great, I'll have a look and see if I can figure something out :) thank you!

<!-- gh-comment-id:762185717 --> @xou816 commented on GitHub (Jan 18, 2021): Great, I'll have a look and see if I can figure something out :) thank you!
Author
Owner

@xou816 commented on GitHub (Jan 22, 2021):

Hi @ashthespy, I opened a PR if you want to have a look! I went with error-chain since it was already part of the dependencies, I hope that's fine?

<!-- gh-comment-id:765237653 --> @xou816 commented on GitHub (Jan 22, 2021): Hi @ashthespy, I opened a PR if you want to have a look! I went with `error-chain` since it was already part of the dependencies, I hope that's fine?
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#363
No description provided.