From 989cd82e90d3c8647a1d69f12977ed80fd15e1e9 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 9 Oct 2019 16:02:17 +0530 Subject: [PATCH] fix: raise SiteExpiredError if site has expired Signed-off-by: Chinmay D. Pai --- frappe/frappeclient.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/frappeclient.py b/frappe/frappeclient.py index c7498319dc..fe5b5844c8 100644 --- a/frappe/frappeclient.py +++ b/frappe/frappeclient.py @@ -11,6 +11,9 @@ FrappeClient is a library that helps you connect with other frappe systems class AuthError(Exception): pass +class SiteExpiredError(Exception): + pass + class FrappeException(Exception): pass @@ -43,7 +46,7 @@ class FrappeClient(object): return r.json() else: if json.loads(r.text).get('exc_type') == "SiteExpiredError": - return {"exc_type": "SiteExpiredError"} + raise SiteExpiredError print(r.text) raise AuthError