mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #193] Better error handling #132
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#132
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 @brain0 on GitHub (Mar 20, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/193
This issue is meant to be a tracking issue for better error handling in librespot. Right now, there are way to many calls to unwrap() on conditions which might fail, resulting in application crashes.
This is particularly annoying when a connection loss results in a crash, instead of reconnecting. It's also annoying when spurious failures on the server side lead to crashes. We need to come up with a way to improve error handling globally in librespot.
@brain0 commented on GitHub (Mar 20, 2018):
Currently, the following issues are a consequence of the lack of proper error handling: #51 #134 #172 #183. I could probably add a few more by looking at my logs.
@sashahilton00 commented on GitHub (Mar 20, 2018):
Indeed, there are a few key errors that are somewhat irritating:
kSupportsPlaylistV2, which realistically didn't break any logic in librespot. If anyone knows how to silence protobuf errors, or turn them into warnings, that would be appreciated.warn!that Spotify appears to be offline at each retry, then panic, as if it's down for more than 10 minutes, chances are there's something bigger going wrong at Spotify.@brain0 commented on GitHub (Mar 20, 2018):
@sashahilton00 Thanks for the summary.
Another reconnection story: I have librespot running on a headless machine. I run it in discovery mode and use Android via wifi to connect it to spotify. It often happens that I listen to some music and then don't use it for several days. When I then try to connect again, it crashes instantly and only works after a restart. I need to capture a backtrace for this, I just installed a non-stripped version and can probably reproduce tomorrow.
I agree on the protobuf thing. I have only dealt with protobuf in C++ and C#, and adding new fields was always non-fatal. If this isn't the case for the Rust implementation, that is a serious problem.
@brain0 commented on GitHub (Mar 20, 2018):
As for protobuf, the problem is here, where an error in an enum variant in a repeated field cannot be ignored. See also here.
@sashahilton00 commented on GitHub (Mar 22, 2018):
For the 5xx errors, shall I just add a check that panics librespot for now? Seems better than hanging indefinitely...