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

fix: KubeStatus message/status/info full explanation

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2023-03-22 14:24:12 +04:00
parent b5187ba75f
commit 1272039e52
2 changed files with 4 additions and 4 deletions

View File

@ -58,9 +58,9 @@ export class PodApi extends KubeApi<Pod> {
const status = new KubeStatus(response); const status = new KubeStatus(response);
if (status.code >= 200 && status.code < 300) { if (status.code >= 200 && status.code < 300) {
return status.getMessage(); return status.getExplanation();
} else { } else {
throw status.getMessage(); throw status.getExplanation();
} }
} }

View File

@ -297,10 +297,10 @@ export class KubeStatus {
this.status = data.status || ""; this.status = data.status || "";
} }
getMessage() { getExplanation(): string {
const { code, message, reason, status } = this; const { code, message, reason, status } = this;
return `${code}: ${message ?? reason ?? status}`; return `${code}: ${message || reason || status}`;
} }
} }