Ignore 504 errors while updating (#6743)

This commit is contained in:
Joakim Sørensen 2020-08-30 09:39:34 +02:00 committed by GitHub
parent 448e9b71b8
commit d8e88bc58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,11 +161,18 @@ export class HassioUpdate extends LitElement {
try {
await this.hass.callApi<HassioResponse<void>>("POST", item.apiPath);
} catch (err) {
showAlertDialog(this, {
title: "Update failed",
text:
typeof err === "object" ? err.body?.message || "Unkown error" : err,
});
// Only show an error if the status code was not 504 (timeout reported by proxies)
if (err.status_code !== 504) {
showAlertDialog(this, {
title: "Update failed",
text:
typeof err === "object"
? typeof err.body === "object"
? err.body.message
: err.body || "Unkown error"
: err,
});
}
}
item.progress = false;
}