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 (#1755)
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> Co-authored-by: Mario Sarcher <msarcher@mirantis.com> Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
424eeef761
commit
a1e5fe42f9
@ -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[] {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user