mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
phabstatus: handle JSON decode error
Summary: Sometimes GraphQL does not return JSON result. Do not crash on the client-side. Context: https://fb.workplace.com/groups/scm/permalink/2565497036833234/ Reviewed By: farnz Differential Revision: D19254348 fbshipit-source-id: 75ca93b1dc8648d5c59915ecf450b9366df13c01
This commit is contained in:
parent
d7504bffa5
commit
3db941beb4
@ -100,6 +100,13 @@ def getdiffstatus(repo, *diffid):
|
|||||||
hint = _("Error info: %s\n") % str(ex)
|
hint = _("Error info: %s\n") % str(ex)
|
||||||
ret = _fail(repo, diffid, msg, hint)
|
ret = _fail(repo, diffid, msg, hint)
|
||||||
return ret
|
return ret
|
||||||
|
except ValueError as ex:
|
||||||
|
msg = _(
|
||||||
|
"Error decoding GraphQL response. No diff information can be provided.\n"
|
||||||
|
)
|
||||||
|
hint = _("Error info: %s\n") % str(ex)
|
||||||
|
ret = _fail(repo, diffid, msg, hint)
|
||||||
|
return ret
|
||||||
|
|
||||||
# This makes the code more robust in case we don't learn about any
|
# This makes the code more robust in case we don't learn about any
|
||||||
# particular revision
|
# particular revision
|
||||||
|
Loading…
Reference in New Issue
Block a user