From 21f5b9d78590c2f4ec6f26e837f9c67bca3f8bb2 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Sun, 6 Sep 2020 16:28:35 +0000 Subject: [PATCH 1/2] Ignore more proxy disconnect codes --- hassio/src/dashboard/hassio-update.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index 3bb15444ed52..ac5ac87aea8a 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -164,8 +164,10 @@ export class HassioUpdate extends LitElement { try { await this.hass.callApi>("POST", item.apiPath); } catch (err) { - // Only show an error if the status code was not 504, or no status at all (connection terminated) - if (err.status_code && err.status_code !== 504) { + // Only show an error if the status code was not expected (user behind proxy) + // or no status at all(connection terminated) + const ignoreCodes = [502, 503, 504]; + if (err.status_code && !ignoreCodes.includes(err.status_code)) { showAlertDialog(this, { title: "Update failed", text: extractApiErrorMessage(err), From 55049ef7a5bf9a08167c9eac3d25e528902429cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sun, 6 Sep 2020 20:09:29 +0200 Subject: [PATCH 2/2] Update hassio/src/dashboard/hassio-update.ts Co-authored-by: Bram Kragten --- hassio/src/dashboard/hassio-update.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index ac5ac87aea8a..9bb6cc73ece1 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -166,8 +166,7 @@ export class HassioUpdate extends LitElement { } catch (err) { // Only show an error if the status code was not expected (user behind proxy) // or no status at all(connection terminated) - const ignoreCodes = [502, 503, 504]; - if (err.status_code && !ignoreCodes.includes(err.status_code)) { + if (err.status_code && ![502, 503, 504].includes(err.status_code)) { showAlertDialog(this, { title: "Update failed", text: extractApiErrorMessage(err),