Skip to content

Commit 03de235

Browse files
authored
Merge pull request librespot-org#198 from librespot-org/500_error
Add 5xx error panic
2 parents 8995f76 + 96124c5 commit 03de235

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/mercury/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ impl MercuryManager {
189189
payload: pending.parts,
190190
};
191191

192-
if response.status_code >= 400 {
192+
if response.status_code >= 500 {
193+
panic!("Spotify servers returned an error. Restart librespot.");
194+
} else if response.status_code >= 400 {
193195
warn!("error {} for uri {}", response.status_code, &response.uri);
194196
if let Some(cb) = pending.callback {
195197
let _ = cb.send(Err(MercuryError));

0 commit comments

Comments
 (0)