Handle string error messages.

fixes #763
This commit is contained in:
softsimon 2021-09-04 01:32:36 +04:00
parent 16e2532cce
commit 3402fbd206

View File

@ -93,7 +93,7 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
if (e === 'failed to get confirmed status') { if (e === 'failed to get confirmed status') {
e = 'The number of transactions on this address exceeds the Electrum server limit'; e = 'The number of transactions on this address exceeds the Electrum server limit';
} }
throw new Error(e instanceof Error ? e.message : 'Error'); throw new Error(typeof e === 'string' ? e : 'Error');
} }
} }
@ -131,7 +131,7 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
if (e === 'failed to get confirmed status') { if (e === 'failed to get confirmed status') {
e = 'The number of transactions on this address exceeds the Electrum server limit'; e = 'The number of transactions on this address exceeds the Electrum server limit';
} }
throw new Error(e instanceof Error ? e.message : 'Error'); throw new Error(typeof e === 'string' ? e : 'Error');
} }
} }