From c263131927cfc24e68c60fa42f1cfa6f2afec6cc Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 28 Jul 2023 19:34:51 -0400 Subject: [PATCH] removed unnecessary try/catch logic --- .../nav/WindowManager/ContainerShell.vue | 10 ++++------ shell/models/pod.js | 14 +++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/shell/components/nav/WindowManager/ContainerShell.vue b/shell/components/nav/WindowManager/ContainerShell.vue index 801a0e5219..2ba567d9dd 100644 --- a/shell/components/nav/WindowManager/ContainerShell.vue +++ b/shell/components/nav/WindowManager/ContainerShell.vue @@ -128,13 +128,11 @@ export default { async mounted() { const nodeId = this.pod.spec?.nodeName; - try { - const schema = this.$store.getters[`cluster/schemaFor`](NODE); + const schema = this.$store.getters[`cluster/schemaFor`](NODE); - if (schema) { - await this.$store.dispatch('cluster/find', { type: NODE, id: nodeId }); - } - } catch {} + if (schema) { + await this.$store.dispatch('cluster/find', { type: NODE, id: nodeId }); + } await this.setupTerminal(); await this.connect(); diff --git a/shell/models/pod.js b/shell/models/pod.js index 0e235f4c54..faee0872fc 100644 --- a/shell/models/pod.js +++ b/shell/models/pod.js @@ -34,15 +34,15 @@ export default class Pod extends WorkloadService { } get node() { - try { - const schema = this.$store.getters[`cluster/schemaFor`](NODE); + const schema = this.$store.getters[`cluster/schemaFor`](NODE); - if (schema) { - this.$dispatch(`find`, { type: NODE, id: this.spec.nodeName }); - } - } catch {} + if (schema) { + this.$dispatch(`find`, { type: NODE, id: this.spec.nodeName }); - return this.$getters['byId'](NODE, this.spec.nodeName); + return this.$getters['byId'](NODE, this.spec.nodeName); + } + + return undefined; } get _availableActions() {