From e7ae5a6f3035c1e09ece5da66d34e3089297f395 Mon Sep 17 00:00:00 2001 From: George Date: Tue, 7 Nov 2023 16:04:57 +0100 Subject: [PATCH] fix(config): json parsing (e.g. ssl) (#203) --- src/config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index cdb7cd5..7ae0f40 100644 --- a/src/config.ts +++ b/src/config.ts @@ -80,13 +80,17 @@ export const connectionOptions = (() => { convertNamedPlaceholders = options.namedPlaceholders === 'false' ? null : require('named-placeholders')(); - for (const key in ['dateStrings', 'flags', 'ssl']) { + for (const key of ['dateStrings', 'flags', 'ssl']) { const value = options[key]; if (typeof value === 'string') { try { options[key] = JSON.parse(value); - } catch {} + } catch (err) { + console.log( + `^3Failed to parse property ${key} in configuration (${err})!^0` + ) + } } }