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