diff --git a/src/dialogs/restart/dialog-restart-wait.ts b/src/dialogs/restart/dialog-restart-wait.ts index 001d72953d..4577675ed6 100644 --- a/src/dialogs/restart/dialog-restart-wait.ts +++ b/src/dialogs/restart/dialog-restart-wait.ts @@ -4,6 +4,7 @@ import type { CSSResultGroup } from "lit"; import { LitElement, css, html, nothing } from "lit"; import { customElement, property, query, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-alert"; import "../../components/ha-dialog-header"; import "../../components/ha-icon-button"; import "../../components/ha-md-dialog"; @@ -29,6 +30,9 @@ class DialogRestartWait extends LitElement { private _actionOnIdle?: () => Promise; + @state() + private _error?: string; + @state() private _backupState?: ManagerState; @@ -97,8 +101,16 @@ class DialogRestartWait extends LitElement { ${this._title}
- - ${waitMessage} + ${this._error + ? html`${this.hass.localize("ui.dialogs.restart.error_backup_state", { + error: this._error, + })} ` + : html` + + ${waitMessage} + `}
`; @@ -125,10 +137,8 @@ class DialogRestartWait extends LitElement { } } ); - } catch (err) { - // TODO show error to user - // eslint-disable-next-line no-console - console.error(err); + } catch (err: any) { + this._error = err.message || err; } } diff --git a/src/translations/en.json b/src/translations/en.json index 723efe9cdc..a81a1fd6c7 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1543,6 +1543,7 @@ "upload_in_progress": "A backup upload is currently in progress. The action will automatically proceed once the upload process is complete.", "restore_in_progress": "A backup restore is currently in progress. The action will automatically proceed once the restore process is complete.", "wait_for_backup": "Wait for the backup creation to finish", + "error_backup_state": "An error occured while getting the current backup state. Error: {error}", "wait_for_upload": "Wait for backup upload to finish", "wait_for_restore": "Wait for backup restore to finish", "reload": {