-
Notifications
You must be signed in to change notification settings - Fork 235
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
Handling ConnectionError, HTTPError thrown during a query #130
Comments
More often than not. You can avoid a few It can also happen due to a flaky connection.
See the approaches in PRs #99 and #100, as well as the issues linked there, for a three-year old (:disappointed:) discussion on this. I never got to merging either approach into the package, since both solutions have issues, and are hard to test properly these days. Github says either of those can still be merged into the code as-is.
Be careful with retries: https://www.reddit.com/r/krakenex/comments/778uvh/psa_http_error_502_does_not_mean_the_query_wont/ This is old, and Kraken has had an iteration on their production code, so the PSA may not apply verbatim - just linking as an example of "unexpected things can happen". |
Marking as duplicate of issue #66, mainly because the solution seems to be the same. Ping back if I misunderstood. |
For those who encounter the same problem, I found the solutions in PRs #99 and #100 were insufficient to prevent the program from crashing. My approach was instead to wrap the price querying code in a shell script that restarts upon failure, which seems to work great although it doesn't solve the underlying problem at the krakenex level. Closing. Thank you for the input! |
Versions
What are you trying to achieve?
I'm looking to record price data in a persistent session. I do this through a simple wrapper class
What happens instead?
The above snippet works for a few hours, then inevitably crashes
I presume this could be a problem on the Kraken end (or perhaps with my internet connection), so I wrap the body of
get_current_asking_price
in a try/except:which again runs for a few hours, but returns a different error (without printing 'encountered a server error. retrying...'):
which seems like a deeper error in requests. Before I make my try/except handling more elaborate, I want to understand what's going on here.
Any pointers would be appreciated!
The text was updated successfully, but these errors were encountered: