mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #198 from librespot-org/500_error
Add 5xx error panic
This commit is contained in:
commit
03de235d2f
2 changed files with 10 additions and 8 deletions
14
Cargo.lock
generated
14
Cargo.lock
generated
|
@ -1,10 +1,3 @@
|
|||
[root]
|
||||
name = "librespot-protocol"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"protobuf 1.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.6.4"
|
||||
|
@ -506,6 +499,13 @@ dependencies = [
|
|||
"portaudio-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "librespot-protocol"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"protobuf 1.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linear-map"
|
||||
version = "1.2.0"
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue