mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 22:43:58 +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) {
|
async function nativeConnect(connection) {
|
||||||
const drivers = ['ODBC Driver 17 for SQL Server', 'SQL Server Native Client 11.0'];
|
const drivers = ['ODBC Driver 17 for SQL Server', 'SQL Server Native Client 11.0'];
|
||||||
|
|
||||||
for (let i = 0; i < drivers.length; i += 1) {
|
for (let i = 0; i < drivers.length; i += 1) {
|
||||||
try {
|
try {
|
||||||
const res = await connectWithDriver(connection, drivers[i]);
|
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);
|
console.error(`Failed connecting with ${drivers[i]} driver, trying next`, err);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw err;
|
throw new Error(`${err}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user