Skip to content

IndexError in get_rate() method #18

@vesellov

Description

@vesellov

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions