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

Notify user if Helm list fails (#2262)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-03-30 10:14:34 -04:00
parent d81774af0d
commit 64ebfc25ae
2 changed files with 8 additions and 3 deletions

View File

@ -70,7 +70,7 @@ class HelmApiRoute extends LensApi {
this.respondJson(response, result); this.respondJson(response, result);
} catch (error) { } catch (error) {
logger.debug(error); logger.debug(error);
this.respondText(response, error); this.respondText(response, error, 422);
} }
} }
@ -83,7 +83,7 @@ class HelmApiRoute extends LensApi {
this.respondJson(response, result); this.respondJson(response, result);
} catch(error) { } catch(error) {
logger.debug(error); logger.debug(error);
this.respondText(response, error); this.respondText(response, error, 422);
} }
} }

View File

@ -6,6 +6,7 @@ import { ItemStore } from "../../item.store";
import { Secret } from "../../api/endpoints"; import { Secret } from "../../api/endpoints";
import { secretsStore } from "../+config-secrets/secrets.store"; import { secretsStore } from "../+config-secrets/secrets.store";
import { namespaceStore } from "../+namespaces/namespace.store"; import { namespaceStore } from "../+namespaces/namespace.store";
import { Notifications } from "../notifications";
@autobind() @autobind()
export class ReleaseStore extends ItemStore<HelmRelease> { export class ReleaseStore extends ItemStore<HelmRelease> {
@ -67,7 +68,11 @@ export class ReleaseStore extends ItemStore<HelmRelease> {
this.items.replace(this.sortItems(items)); this.items.replace(this.sortItems(items));
this.isLoaded = true; this.isLoaded = true;
} catch (error) { } catch (error) {
console.error(`Loading Helm Chart releases has failed: ${error}`); console.error("Loading Helm Chart releases has failed", error);
if (error.error) {
Notifications.error(error.error);
}
} finally { } finally {
this.isLoading = false; this.isLoading = false;
} }