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

Apply suggestions from code review

Co-authored-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-11-24 09:09:24 +02:00
parent 1d29c1a841
commit 1d5dbb0788

View File

@ -1,4 +1,3 @@
import _ from "lodash";
import { LensApiRequest } from "../router";
import { LensApi } from "../lens-api";
@ -25,6 +24,7 @@ async function loadMetrics(promQueries: string[], cluster: Cluster, prometheusPa
return await cluster.getMetrics(prometheusPath, { query, ...queryParams });
} catch (error) {
if (lastAttempt || (error?.statusCode >= 400 && error?.statusCode < 500)) {
logger.error("[Metrics]: metrics not available", { err });
throw new Error("Metrics not available");
}