1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Catch HTTP Errors in case pod metrics resources do not exist or access is forbidden

Signed-off-by: Mario Sarcher <msarcher@mirantis.com>

Add proper error message when catching a error during loadKubeMetrics()

Co-authored-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Mario Sarcher <msarcher@mirantis.com>
This commit is contained in:
Mario Sarcher 2020-12-11 14:14:16 +01:00
parent a61e20965d
commit 8b7716c7a3

View File

@ -23,9 +23,12 @@ export class PodsStore extends KubeObjectStore<Pod> {
}
async loadKubeMetrics(namespace?: string) {
const metrics = await podMetricsApi.list({ namespace });
this.kubeMetrics.replace(metrics);
try {
const metrics = await podMetricsApi.list({ namespace });
this.kubeMetrics.replace(metrics);
} catch (error) {
console.error("loadKubeMetrics failed", error);
}
}
getPodsByOwner(workload: WorkloadKubeObject): Pod[] {