Merge pull request #5905 from netchampfaris/frappe-client
Extract traceback from failed FrappeClient request and frappe.throw it
This commit is contained in:
commit
544707d478
1 changed files with 7 additions and 1 deletions
|
|
@ -286,7 +286,13 @@ class FrappeClient(object):
|
|||
raise
|
||||
|
||||
if rjson and ("exc" in rjson) and rjson["exc"]:
|
||||
raise FrappeException(rjson["exc"])
|
||||
try:
|
||||
exc = json.loads(rjson["exc"])[0]
|
||||
exc = 'FrappeClient Request Failed\n\n' + exc
|
||||
except Exception:
|
||||
exc = rjson["exc"]
|
||||
|
||||
raise FrappeException(exc)
|
||||
if 'message' in rjson:
|
||||
return rjson['message']
|
||||
elif 'data' in rjson:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue