Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError in get_rate() method #18

Open
vesellov opened this issue Jul 21, 2022 · 2 comments
Open

IndexError in get_rate() method #18

vesellov opened this issue Jul 21, 2022 · 2 comments

Comments

@vesellov
Copy link
Contributor

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!

@NicolasDorier
Copy link
Member

thanks, what rate source are you using?

@vesellov
Copy link
Contributor Author

Hi @NicolasDorier
It is CoingGecko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants