Allow pending as a response
This commit is contained in:
parent
550b3d9f51
commit
92504e0b34
|
@ -76,7 +76,7 @@ class RefineServer(object):
|
||||||
def urlopen_json(self, *args, **kwargs):
|
def urlopen_json(self, *args, **kwargs):
|
||||||
"""Open a Refine URL, optionally POST data, and return parsed JSON."""
|
"""Open a Refine URL, optionally POST data, and return parsed JSON."""
|
||||||
response = json.loads(self.urlopen(*args, **kwargs).read())
|
response = json.loads(self.urlopen(*args, **kwargs).read())
|
||||||
if 'code' in response and response['code'] != 'ok':
|
if 'code' in response and response['code'] not in ('ok', 'pending'):
|
||||||
raise Exception(
|
raise Exception(
|
||||||
response['code'] + ': ' +
|
response['code'] + ': ' +
|
||||||
response.get('message', response.get('stack', response)))
|
response.get('message', response.get('stack', response)))
|
||||||
|
|
Loading…
Reference in New Issue