fix: handle site expired exception

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Co-authored-by: Sahil Khan <sahilkhan28297@gmail.com>
This commit is contained in:
Chinmay D. Pai 2019-10-09 15:47:25 +05:30
parent e9e2a89dc8
commit c560d2fb51
No known key found for this signature in database
GPG key ID: 75507BE256F40CED

View file

@ -42,6 +42,8 @@ class FrappeClient(object):
if r.status_code==200 and r.json().get('message') in ("Logged In", "No App"):
return r.json()
else:
if json.loads(r.text).get('exc_type') == "SiteExpiredError":
return {"exc_type": "SiteExpiredError"}
print(r.text)
raise AuthError