[GH-ISSUE #1167] Expose AuthenticationError enum #540

Open
opened 2026-02-27 19:31:11 +03:00 by kerem · 8 comments
Owner

Originally created by @beaverking1212 on GitHub (May 17, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1167

Is your feature request related to a problem? Please describe.
There is a problem. When calling Session::connect() it is hard to determine whether login has failed or another error occurred.

Describe the solution you'd like
I want to be able to check whether Session::connect() returned error due to failed login.

Describe alternatives you've considered
Alternative is converting error to text, it works, but looks fragile.
gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-@ea26d0d6d5/audio/spotify/src/common.rs (L170)

Additional context
Problem was noticed in: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1195

Originally created by @beaverking1212 on GitHub (May 17, 2023). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1167 **Is your feature request related to a problem? Please describe.** There is a problem. When calling `Session::connect()` it is hard to determine whether login has failed or another error occurred. **Describe the solution you'd like** I want to be able to check whether `Session::connect()` returned error due to failed login. **Describe alternatives you've considered** Alternative is converting error to text, it works, but looks fragile. https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/blob/ea26d0d6d50bc0fd394c8934b14d18266671264b/audio/spotify/src/common.rs#L170 **Additional context** Problem was noticed in: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1195
Author
Owner

@beaverking1212 commented on GitHub (May 17, 2023):

@gdesmott

<!-- gh-comment-id:1550613024 --> @beaverking1212 commented on GitHub (May 17, 2023): @gdesmott
Author
Owner

@kingosticks commented on GitHub (Oct 7, 2024):

FYI this is fixed in dev branch

<!-- gh-comment-id:2397225180 --> @kingosticks commented on GitHub (Oct 7, 2024): FYI this is fixed in dev branch
Author
Owner

@4310V343k commented on GitHub (Sep 21, 2025):

FYI this is fixed in dev branch

Can you link the commit? I don't think librespot::core::connection::AuthenticationError is exported anywhere

<!-- gh-comment-id:3315948314 --> @4310V343k commented on GitHub (Sep 21, 2025): > FYI this is fixed in dev branch Can you link the commit? I don't think `librespot::core::connection::AuthenticationError` is exported anywhere
Author
Owner
<!-- gh-comment-id:3315973233 --> @kingosticks commented on GitHub (Sep 21, 2025): https://docs.rs/librespot-core/0.7.1/librespot_core/authentication/enum.AuthenticationError.html
Author
Owner

@4310V343k commented on GitHub (Sep 21, 2025):

docs.rs/librespot-core/0.7.1/librespot_core/authentication/enum.AuthenticationError.html

The AuthenticationError enum mentioned is located in librespot::core::connection::AuthenticationError, not librespot::core::authentication::AuthenticationError

<!-- gh-comment-id:3315974903 --> @4310V343k commented on GitHub (Sep 21, 2025): > [docs.rs/librespot-core/0.7.1/librespot_core/authentication/enum.AuthenticationError.html](https://docs.rs/librespot-core/0.7.1/librespot_core/authentication/enum.AuthenticationError.html) The `AuthenticationError` enum mentioned is located in `librespot::core::connection::AuthenticationError`, not `librespot::core::authentication::AuthenticationError`
Author
Owner

@kingosticks commented on GitHub (Oct 3, 2025):

Yep, sorry, you are right. I didn't look hard enough at what you were asking and then lost this one.

I don't think there is a real reason we don't expose it other than it lives in a module we don't generally expose. I think agree it's useful and worth improving. What's the easiest way to expose just that? Can you submit a PR?

<!-- gh-comment-id:3365863717 --> @kingosticks commented on GitHub (Oct 3, 2025): Yep, sorry, you are right. I didn't look hard enough at what you were asking and then lost this one. I don't think there is a real reason we don't expose it other than it lives in a module we don't generally expose. I think agree it's useful and worth improving. What's the easiest way to expose just that? Can you submit a PR?
Author
Owner

@4310V343k commented on GitHub (Oct 3, 2025):

What's the easiest way to expose just that?

Similar to this, perhaps?
github.com/librespot-org/librespot@a407beaa45/core/src/lib.rs (L41-L46)

<!-- gh-comment-id:3365919757 --> @4310V343k commented on GitHub (Oct 3, 2025): > What's the easiest way to expose just that? Similar to this, perhaps? https://github.com/librespot-org/librespot/blob/a407beaa45e140f492f9cc5b3c5cdd3c7fe2ad69/core/src/lib.rs#L41-L46
Author
Owner

@kingosticks commented on GitHub (Oct 3, 2025):

Feel free to submit an appropriate PR. Please include a changelog entry.

<!-- gh-comment-id:3366026838 --> @kingosticks commented on GitHub (Oct 3, 2025): Feel free to submit an appropriate PR. Please include a changelog entry.
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#540
No description provided.