mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: A duplicate tx may result in HTTP 500.
* Improve parsing of errors received from Tendermint RPC.
This commit is contained in:
parent
f55f22144f
commit
c68fab6c31
@ -100,7 +100,14 @@ class BigchainDB(object):
|
||||
|
||||
error = response.get('error')
|
||||
if error:
|
||||
return (500, error)
|
||||
status_code = 500
|
||||
message = error.get('message', 'Internal Error')
|
||||
data = error.get('data', '')
|
||||
|
||||
if 'Tx already exists in cache' in data:
|
||||
status_code = 400
|
||||
|
||||
return (status_code, message + ' - ' + data)
|
||||
|
||||
result = response['result']
|
||||
if mode == self.mode_commit:
|
||||
|
Loading…
x
Reference in New Issue
Block a user