Skip to content

Commit

Permalink
Add error message to landing-page dns set fail
Browse files Browse the repository at this point in the history
  • Loading branch information
wendevlin committed Nov 20, 2024
1 parent 1989850 commit 8ad6873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions landing-page/src/components/landing-page-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,15 @@ class LandingPageNetwork extends LitElement {
throw new Error("Failed to set DNS");
}
this._networkIssue = false;
} catch (err) {
} catch (err: any) {
// eslint-disable-next-line no-console
console.error(err);
showAlertDialog(this, {
title: this.localize("network_issue.failed"),
text: this.localize("network_issue.set_dns_failed"),
warning: true,
text: `${this.localize(
"network_issue.set_dns_failed"
)}${err?.message ? ` ${this.localize("network_issue.error")}: ${err.message}` : ""}`,
confirmText: this.localize("network_issue.close"),
});
}
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7522,6 +7522,7 @@
"no_primary_interface": "Home Assistant OS wasn't able to detect a primary network interface, so you cannot define a DNS server!",
"failed": "Failed",
"set_dns_failed": "An error occurred while setting the DNS server. Please check the logs for more information and try again.",
"error": "Error",
"close": "[%key:ui::common::close%]"
},
"logs": {
Expand Down

0 comments on commit 8ad6873

Please sign in to comment.