mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 04:26:01 +00:00
report error from mssql native connect
This commit is contained in:
@@ -64,6 +64,7 @@ async function connectWithDriver({ server, port, user, password, database, authT
|
||||
|
||||
async function nativeConnect(connection) {
|
||||
const drivers = ['ODBC Driver 17 for SQL Server', 'SQL Server Native Client 11.0'];
|
||||
|
||||
for (let i = 0; i < drivers.length; i += 1) {
|
||||
try {
|
||||
const res = await connectWithDriver(connection, drivers[i]);
|
||||
@@ -74,7 +75,7 @@ async function nativeConnect(connection) {
|
||||
console.error(`Failed connecting with ${drivers[i]} driver, trying next`, err);
|
||||
continue;
|
||||
}
|
||||
throw err;
|
||||
throw new Error(`${err}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user