From f64238931c69683e551dcb6798d0047d22e02827 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Mon, 7 Sep 2020 12:21:14 +0100 Subject: [PATCH] FIX: better handling of errors from HodlHodl --- class/app-storage.js | 2 -- class/hodl-hodl-api.js | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/class/app-storage.js b/class/app-storage.js index cb9a7b157..8ac5a2be3 100644 --- a/class/app-storage.js +++ b/class/app-storage.js @@ -408,14 +408,12 @@ export class AppStorage { offloadWalletToRealm(realm, wallet) { const id = wallet.getID(); - console.log('offloading wallet id', id); const walletToSave = wallet._hdWalletInstance ?? wallet; if (walletToSave instanceof AbstractHDElectrumWallet) { realm.write(() => { const j1 = JSON.stringify(walletToSave._txs_by_external_index); const j2 = JSON.stringify(walletToSave._txs_by_internal_index); - console.log('j1 = ', j1.length / 1024, 'kb; j2 = ', j2.length / 1024, 'kb'); realm.create( 'Wallet', { diff --git a/class/hodl-hodl-api.js b/class/hodl-hodl-api.js index a98224ebb..3d14996dd 100644 --- a/class/hodl-hodl-api.js +++ b/class/hodl-hodl-api.js @@ -226,7 +226,11 @@ export class HodlHodlApi { validationErrorsToReadable(errorz) { const ret = []; for (const er of Object.keys(errorz)) { - ret.push(errorz[er].join('; ')); + if (Array.isArray(errorz[er])) { + ret.push(errorz[er].join('; ')); + } else { + ret.push(errorz[er]); + } } return ret.join('\n');