mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Ignore diagnostics not found exceptions (#12066)
This commit is contained in:
parent
5247b2813f
commit
ea19740f5a
@ -33,6 +33,7 @@ import {
|
|||||||
fetchDiagnosticHandler,
|
fetchDiagnosticHandler,
|
||||||
getDeviceDiagnosticsDownloadUrl,
|
getDeviceDiagnosticsDownloadUrl,
|
||||||
getConfigEntryDiagnosticsDownloadUrl,
|
getConfigEntryDiagnosticsDownloadUrl,
|
||||||
|
DiagnosticInfo,
|
||||||
} from "../../../data/diagnostics";
|
} from "../../../data/diagnostics";
|
||||||
import {
|
import {
|
||||||
EntityRegistryEntry,
|
EntityRegistryEntry,
|
||||||
@ -219,11 +220,20 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let links = await Promise.all(
|
let links = await Promise.all(
|
||||||
this._integrations(device, this.entries).map(async (entry) => {
|
this._integrations(device, this.entries).map(
|
||||||
|
async (entry): Promise<boolean | { link: string; domain: string }> => {
|
||||||
if (entry.state !== "loaded") {
|
if (entry.state !== "loaded") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const info = await fetchDiagnosticHandler(this.hass, entry.domain);
|
let info: DiagnosticInfo;
|
||||||
|
try {
|
||||||
|
info = await fetchDiagnosticHandler(this.hass, entry.domain);
|
||||||
|
} catch (err: any) {
|
||||||
|
if (err.code === "not_found") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
if (!info.handlers.device && !info.handlers.config_entry) {
|
if (!info.handlers.device && !info.handlers.config_entry) {
|
||||||
return false;
|
return false;
|
||||||
@ -234,7 +244,8 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
: getConfigEntryDiagnosticsDownloadUrl(entry.entry_id),
|
: getConfigEntryDiagnosticsDownloadUrl(entry.entry_id),
|
||||||
domain: entry.domain,
|
domain: entry.domain,
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
links = links.filter(Boolean);
|
links = links.filter(Boolean);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user