From 0fbb8c7cc7af0c826bd44e242711c438445c7006 Mon Sep 17 00:00:00 2001 From: ecmel Date: Mon, 18 Nov 2024 17:46:40 +0300 Subject: [PATCH] fixed bundled connect error message --- src/classes/localConnection.ts | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/classes/localConnection.ts b/src/classes/localConnection.ts index ae6469fc..0dfc46dd 100644 --- a/src/classes/localConnection.ts +++ b/src/classes/localConnection.ts @@ -76,12 +76,31 @@ export class LocalConnection { if (err || !conn) { ext.serverProvider.reload(); - window.showErrorMessage( - `Connection to server ${this.options.host}:${this.options.port} failed! Details: ${err?.message}`, - ); + if (this.connLabel.endsWith("[local]")) { + window + .showErrorMessage( + `Connection to server ${this.options.host}:${this.options.port} failed.`, + "Start q process", + ) + .then((res) => { + if (res) { + commands.executeCommand( + "kdb.startLocalProcess", + ext.connectionsList.find( + (conn) => conn.label === this.connLabel, + ), + ); + } + }); + } else { + window.showErrorMessage( + `Connection to server ${this.options.host}:${this.options.port} failed.`, + ); + } + kdbOutputLog( `Connection to server ${this.options.host}:${this.options.port} failed! Details: ${err?.message}`, - "ERROR", + "CONNECTION", ); return; }