Merge pull request #764 from mempool/simon/electrum-error-msg-fix

Handle string error messages.
This commit is contained in:
wiz 2021-09-04 09:17:46 +09:00 committed by GitHub
commit fde6fe324a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
if (e === 'failed to get confirmed status') {
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') {
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');
}
}