diff --git a/src/components/CliConsole.vue b/src/components/CliConsole.vue index ba59ad7..c72555b 100644 --- a/src/components/CliConsole.vue +++ b/src/components/CliConsole.vue @@ -92,31 +92,41 @@ export default { this.$nextTick(() => { this.scrollToBottom(); }); - } else { - promise.then((reply) => { - let append = ''; - if (reply === null) { - append = `${null}\n`; - } else if (typeof reply === 'object') { - const isArray = !isNaN(reply.length); - - for (const i in reply) { - append += `${(isArray ? '' : (`${i}\n`)) + reply[i]}\n`; - } - } else { - append = `${reply}\n`; - } - - this.cliContent.content += append; - this.inputSuggestionItems.delete(params); - this.inputSuggestionItems.add(params); - - this.$nextTick(() => { - this.scrollToBottom(); - }); - }); + return; } + + promise.then((reply) => { + let append = ''; + + if (reply === null) { + append = `${null}\n`; + } + else if (typeof reply === 'object') { + const isArray = !isNaN(reply.length); + + for (const i in reply) { + append += `${(isArray ? '' : (`${i}\n`)) + reply[i]}\n`; + } + } + else { + append = `${reply}\n`; + } + + this.cliContent.content += append; + this.inputSuggestionItems.delete(params); + this.inputSuggestionItems.add(params); + + this.$nextTick(() => { + this.scrollToBottom(); + }); + }).catch((err) => { + this.cliContent.content += `${err.message}\n`; + + this.$nextTick(() => { + this.scrollToBottom(); + }); + }); }, searchUp() { if (--this.historyIndex < (-this.inputSuggestionItems.size - 1)) { diff --git a/src/components/Connections.vue b/src/components/Connections.vue index 4f88178..cfdb281 100644 --- a/src/components/Connections.vue +++ b/src/components/Connections.vue @@ -286,6 +286,10 @@ export default { else { this.$set(this.dbs, menuIndex, [...Array(16).keys()]); } + }).catch((err) => { + // config command may be renamed + console.log(`get config databases failed, ${err.message}`); + this.$set(this.dbs, menuIndex, [...Array(16).keys()]); }); }, setGlobalConnection(menuIndex, connection) {