mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 09:44:00 +00:00
native ms sql connect fix + logs
This commit is contained in:
@@ -67,9 +67,13 @@ async function nativeConnect(connection) {
|
|||||||
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]);
|
||||||
|
console.error(`Connected SQL Server with ${drivers[i]} driver`);
|
||||||
return res;
|
return res;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.message.includes('[ODBC Driver Manager]') && i < drivers.length - 1) continue;
|
if (err.message && err.message.includes('[ODBC Driver Manager]') && i < drivers.length - 1) {
|
||||||
|
console.error(`Failed connecting with ${drivers[i]} driver, trying next`, err);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user