Handle new type of Electrum Server error.

fixes #872
This commit is contained in:
softsimon
2021-10-23 11:46:38 +04:00
parent fbc91b6d6b
commit 18d17e5f29
3 changed files with 10 additions and 13 deletions

View File

@@ -87,11 +87,8 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
},
'electrum': true,
};
} catch (e) {
if (e === 'failed to get confirmed status') {
e = 'The number of transactions on this address exceeds the Electrum server limit';
}
throw new Error(typeof e === 'string' ? e : 'Error');
} catch (e: any) {
throw new Error(typeof e === 'string' ? e : e && e.message || e);
}
}
@@ -124,12 +121,9 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
}
return transactions;
} catch (e) {
} catch (e: any) {
loadingIndicators.setProgress('address-' + address, 100);
if (e === 'failed to get confirmed status') {
e = 'The number of transactions on this address exceeds the Electrum server limit';
}
throw new Error(typeof e === 'string' ? e : 'Error');
throw new Error(typeof e === 'string' ? e : e && e.message || e);
}
}