mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Check for the error field first.
This commit is contained in:
parent
4b6d30f20d
commit
ba4246d424
@ -96,6 +96,10 @@ class BigchainDB(object):
|
||||
def _process_post_response(self, response, mode):
|
||||
logger.debug(response)
|
||||
|
||||
error = response.get('error')
|
||||
if error:
|
||||
return (500, error)
|
||||
|
||||
result = response['result']
|
||||
if mode == self.mode_commit:
|
||||
check_tx_code = result.get('check_tx', {}).get('code', 0)
|
||||
@ -104,10 +108,6 @@ class BigchainDB(object):
|
||||
else:
|
||||
error_code = result.get('code', 0)
|
||||
|
||||
error = response.get('error')
|
||||
if error:
|
||||
return (500, error)
|
||||
|
||||
if error_code:
|
||||
return (500, 'Transaction validation failed')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user