app: fix error
This commit is contained in:
parent
f34b85d79f
commit
20423379a2
|
@ -182,7 +182,12 @@ def set_session_token_id(token_id):
|
|||
|
||||
def raise_for_status(response):
|
||||
if response.status_code not in range(200, 300):
|
||||
raise Exception(f'HTTPError: {response.status_code} \n Message: {response.json()}')
|
||||
msg = None
|
||||
try:
|
||||
msg = response.json().get('error', '')
|
||||
except:
|
||||
pass
|
||||
raise Exception(f'HTTPError: {response.status_code} \n Message: {msg}')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', debug=True, port=5000)
|
Loading…
Reference in New Issue
Block a user