mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: Error response not handled in POST transaction to tendermint (#2219)
Solution: Handle the error response
This commit is contained in:
parent
0cf0927193
commit
1823818315
@ -62,15 +62,16 @@ class BigchainDB(Bigchain):
|
||||
|
||||
def _process_post_response(self, response, mode):
|
||||
logger.debug(response)
|
||||
result = response['result']
|
||||
if mode == MODE_LIST[1]:
|
||||
status_code = result['check_tx']['code']
|
||||
return self._process_status_code(status_code,
|
||||
'Error while validating the transaction')
|
||||
elif mode == MODE_LIST[2]:
|
||||
return self._process_commit_mode_response(result)
|
||||
if response.get('error') is not None:
|
||||
return (500, 'Internal error')
|
||||
|
||||
return (202, '')
|
||||
result = response['result']
|
||||
if mode == MODE_LIST[2]:
|
||||
return self._process_commit_mode_response(result)
|
||||
else:
|
||||
status_code = result['code']
|
||||
return self._process_status_code(status_code,
|
||||
'Error while processing transaction')
|
||||
|
||||
def _process_commit_mode_response(self, result):
|
||||
check_tx_status_code = result['check_tx']['code']
|
||||
|
Loading…
x
Reference in New Issue
Block a user