mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
native ms sql connect fix + logs
This commit is contained in:
parent
50a22b63d0
commit
c571582ed8
@ -67,9 +67,13 @@ async function nativeConnect(connection) {
|
||||
for (let i = 0; i < drivers.length; i += 1) {
|
||||
try {
|
||||
const res = await connectWithDriver(connection, drivers[i]);
|
||||
console.error(`Connected SQL Server with ${drivers[i]} driver`);
|
||||
return res;
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user