btcpayserver / btcpayserver/btcpay-python
IndexError in get_rate() method
- Dominant language
- Python
- Stars
- 79
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Hello guys. Thank you for the work you are doing.
Wanted to report a small bug to you. It looks like our BTCPay node is not very stable sometimes or there are some networking issues. For some reason `client.get_rate("USD")` occasionally may throw an `IndexError list index out of range` exception.
Based on the info from our Sentry dashboard I do see that `get_rates()` method returned an empty list and then further, on line 97 it will brake, because it tries to access the first element of the empty list `rates = []` : https://github.com/btcpayserver/btcpay-python/blob/master/btcpay/client.py#L97
Not sure if you like to raise another error in that case, but just decided to report it here.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.