Handle string error messages.

fixes #763
This commit is contained in:
softsimon 2021-09-04 01:32:36 +04:00
parent ad6503c7b3
commit 0b077d6fda
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

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');
}
}