Selaa lähdekoodia

fix: raise SiteExpiredError if site has expired

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
version-14
Chinmay D. Pai 5 vuotta sitten
vanhempi
commit
989cd82e90
No known key found for this signature in database GPG Key ID: 75507BE256F40CED
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. +4
    -1
      frappe/frappeclient.py

+ 4
- 1
frappe/frappeclient.py Näytä tiedosto

@@ -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



Ladataan…
Peruuta
Tallenna