fix(updater): Propagate request error

pull/2439/head
Fabian-Lars 5 months ago committed by GitHub
parent 9229f991fe
commit e52f5661bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -383,15 +383,15 @@ impl Updater {
.send()
.await;
if let Ok(res) = response {
match response {
Ok(res) => {
if res.status().is_success() {
// no updates found!
if StatusCode::NO_CONTENT == res.status() {
return Ok(None);
};
raw_json = Some(res.json().await?);
match serde_json::from_value::<RemoteRelease>(raw_json.clone().unwrap())
match serde_json::from_value::<RemoteRelease>(res.json().await?)
.map_err(Into::into)
{
Ok(release) => {
@ -404,6 +404,8 @@ impl Updater {
}
}
}
Err(err) => last_error = Some(err.into()),
}
}
// Last error is cleaned on success.

Loading…
Cancel
Save