mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #566] [MERGED] fix: map authentication errors to a custom error type #971
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#971
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?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/566
Author: @xou816
Created: 1/18/2021
Status: ✅ Merged
Merged: 2/6/2021
Merged by: @sashahilton00
Base:
dev← Head:fix/map-auth-errors📝 Commits (1)
71e9295fix: map authentication errors to a custom error type📊 Changes
4 files changed (+51 additions, -14 deletions)
View changed files
📝
core/src/authentication.rs(+35 -0)📝
core/src/connection/mod.rs(+4 -6)📝
core/src/session.rs(+9 -5)📝
src/main.rs(+3 -3)📄 Description
Fixes #565
Errors encountered during authenticate() are mapped to a custom error type with an ErrorKind enum (
BadCredentials,PremiumAccountRequired,Io(wraps io errors) andMsg(generated, used as a default kind to keep unmapped errors readable)) instead of panicking.I am not sure how backward compatibility is usually handled here however! I was thinking about adding this error mapping to a new Session::try_connect (not sure about the naming) function, while keeping the same behavior for Session::connect
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.