mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
76ee3656a2
commit
da3aa618d7
1 file changed
+5
@@ -114,11 +114,16 @@ export abstract class KubeObjectStore<T extends KubeObject = any> extends ItemSt
|
|||||||
this.isLoaded = true;
|
this.isLoaded = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Loading store items failed", { error, store: this });
|
console.error("Loading store items failed", { error, store: this });
|
||||||
|
this.resetOnError(error);
|
||||||
} finally {
|
} finally {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected resetOnError(error: any) {
|
||||||
|
if (error) this.reset();
|
||||||
|
}
|
||||||
|
|
||||||
protected async loadItem(params: { name: string; namespace?: string }): Promise<T> {
|
protected async loadItem(params: { name: string; namespace?: string }): Promise<T> {
|
||||||
return this.api.get(params);
|
return this.api.get(params);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user