From 806fc79eea468e7514f5af8a707deab9d38202f2 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 10 Jul 2025 22:21:17 -0400 Subject: [PATCH] improve error handling for netdb create --- app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index a93473d8..b903136a 100644 --- a/app.js +++ b/app.js @@ -46,9 +46,13 @@ netdb.create = async function(map = {}) { Object.assign(map, JSON.parse(fs.readFileSync(map.conf))); } const client = new netdb(); - if (map.host && map.port) await client.open(map.host, map.port); - if (map.user && map.pass) await client.auth(map.user, map.pass); - if (map.base) await client.use(map.base); + try { + if (map.host && map.port) await client.open(map.host, map.port); + if (map.user && map.pass) await client.auth(map.user, map.pass); + if (map.base) await client.use(map.base); + } catch (e) { + logger.log({ netdb_setup_error: e }); + } logger.log({ netdb: map.host, user: map.user, base: map.base }); return client; };