seansullivan44 / Wealthsimple-Trade-Python

Python wrapper for the Wealthsimple Trade API
MIT License
49 stars 23 forks source link

Sometimes error getting positions #12

Open danielaird27 opened 3 years ago

danielaird27 commented 3 years ago

I obtain my positions every 5 minutes or so and everything works most of the time but after a random amount of time, I get this error:

Traceback (most recent call last): File "/home/danm/Documents/Trade/trade.py", line 427, in getCurrentPositions positions = ws.get_positions(account_ids[0]) File "/home/danm/.local/lib/python3.9/site-packages/wealthsimple/wealthsimple.py", line 283, in get_positions return response["results"] KeyError: 'results'

What could cause this issue? What are your opinions on how to fix this problem?

danielaird27 commented 3 years ago

Also, once this error occurs once, it will occur every next time I try to obtain my positions (every 5 minutes)

seansullivan44 commented 3 years ago

Sounds like a login that hits a timeout. I will look more into this.