Raise any unexpected error

kivy_mainline_and_py3.8
Tyler Goodlet 2018-02-14 18:49:58 -05:00
parent 0faec1537e
commit b41b262b7d
1 changed files with 3 additions and 2 deletions

View File

@ -125,15 +125,16 @@ class Client:
try:
data = await self._new_auth_token()
except QuestradeError as qterr:
if "We're making some changes" in qterr.args[0]:
if "We're making some changes" in str(qterr.args[0]):
# API service is down
raise QuestradeError("API is down for maintenance")
elif qterr.args[0].decode() == 'Bad Request':
# likely config ``refresh_token`` is expired
_token_from_user(self._conf)
self._apply_config(self._conf)
data = await self._new_auth_token()
else:
raise qterr
# store absolute token expiry time
self.access_data['expires_at'] = time.time() + float(