From 64ba7a56cb27d7d5210a7158f5b3d2b89872e6df Mon Sep 17 00:00:00 2001 From: ekzyis Date: Fri, 13 Dec 2024 11:30:28 +0100 Subject: [PATCH] Fix missing wallet error logging --- wallets/config.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/wallets/config.js b/wallets/config.js index 8ddcfc71..7a078ab4 100644 --- a/wallets/config.js +++ b/wallets/config.js @@ -37,17 +37,22 @@ export function useWalletConfigurator (wallet) { let serverConfig = serverWithShared if (canSend({ def: wallet.def, config: clientConfig })) { - let transformedConfig = await validateWallet(wallet.def, clientWithShared, { skipGenerated: true }) - if (transformedConfig) { - clientConfig = Object.assign(clientConfig, transformedConfig) - } - if (wallet.def.testSendPayment && validateLightning) { - transformedConfig = await wallet.def.testSendPayment(clientConfig, { me, logger }) + try { + let transformedConfig = await validateWallet(wallet.def, clientWithShared, { skipGenerated: true }) if (transformedConfig) { clientConfig = Object.assign(clientConfig, transformedConfig) } - // validate again to ensure generated fields are valid - await validateWallet(wallet.def, clientConfig) + if (wallet.def.testSendPayment && validateLightning) { + transformedConfig = await wallet.def.testSendPayment(clientConfig, { me, logger }) + if (transformedConfig) { + clientConfig = Object.assign(clientConfig, transformedConfig) + } + // validate again to ensure generated fields are valid + await validateWallet(wallet.def, clientConfig) + } + } catch (err) { + logger.error(err.message) + throw err } } else if (canReceive({ def: wallet.def, config: serverConfig })) { const transformedConfig = await validateWallet(wallet.def, serverConfig)