From 214ec281d0efd6a3ab7265be6f2d91dace5b12b5 Mon Sep 17 00:00:00 2001 From: "Visal .In" Date: Thu, 12 Dec 2024 09:24:21 +0700 Subject: [PATCH] show friendly test connection error --- src/connections/sql-base.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connections/sql-base.ts b/src/connections/sql-base.ts index 89d62eb..551c59b 100644 --- a/src/connections/sql-base.ts +++ b/src/connections/sql-base.ts @@ -332,6 +332,9 @@ export abstract class SqlConnection extends Connection { await this.disconnect(); return { error: error ? error.message : undefined }; } catch (error) { + if (error instanceof Error) { + return { error: error.message }; + } return { error: 'Unexpected error' }; } }