mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
phabricator: check for error
field in reponse
Summary: The latest error reponses that we see for phabricator have only one field called `error` that lists a message. Adding handling for this case. Reviewed By: quark-zju Differential Revision: D17290349 fbshipit-source-id: ebfd9d7b07f30cbfe3171259efcfc6a00a1abdce
This commit is contained in:
parent
97c13edcc7
commit
b2471ea3c6
@ -208,8 +208,13 @@ class Client(object):
|
||||
|
||||
def _processrevisioninfo(self, ret):
|
||||
try:
|
||||
errormsg = ret["errors"][0]["message"]
|
||||
raise ClientError(None, errormsg)
|
||||
errormsg = None
|
||||
if "error" in ret:
|
||||
errormsg = ret["error"]
|
||||
if "errors" in ret:
|
||||
errormsg = ret["errors"][0]["message"]
|
||||
if errormsg is not None:
|
||||
raise ClientError(None, errormsg)
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user