1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 01:39:28 +02:00

Add 5xx error panic

This commit is contained in:
Sasha Hilton 2018-04-06 02:44:06 +02:00
parent 8995f7609f
commit 96124c5e18
2 changed files with 10 additions and 8 deletions

View file

@ -189,7 +189,9 @@ impl MercuryManager {
payload: pending.parts,
};
if response.status_code >= 400 {
if response.status_code >= 500 {
panic!("Spotify servers returned an error. Restart librespot.");
} else if response.status_code >= 400 {
warn!("error {} for uri {}", response.status_code, &response.uri);
if let Some(cb) = pending.callback {
let _ = cb.send(Err(MercuryError));