mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: TODO to improve error reporting in one of the queries
Solution: Raise an exception with some info about what failed
This commit is contained in:
parent
f66f30f4cb
commit
bec2abeb55
@ -7,6 +7,7 @@
|
|||||||
from pymongo import DESCENDING
|
from pymongo import DESCENDING
|
||||||
|
|
||||||
from bigchaindb import backend
|
from bigchaindb import backend
|
||||||
|
from bigchaindb.backend import exceptions
|
||||||
from bigchaindb.backend.exceptions import DuplicateKeyError
|
from bigchaindb.backend.exceptions import DuplicateKeyError
|
||||||
from bigchaindb.backend.utils import module_dispatch_registrar
|
from bigchaindb.backend.utils import module_dispatch_registrar
|
||||||
from bigchaindb.backend.localmongodb.connection import LocalMongoDBConnection
|
from bigchaindb.backend.localmongodb.connection import LocalMongoDBConnection
|
||||||
@ -227,8 +228,10 @@ def store_unspent_outputs(conn, *unspent_outputs):
|
|||||||
ordered=False,
|
ordered=False,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
except DuplicateKeyError:
|
except DuplicateKeyError as err:
|
||||||
# TODO log warning at least
|
raise exceptions.DuplicateKeyError(
|
||||||
|
f'Duplicate key in transactions list {unspent_outputs}. Exception raised with error {err}'
|
||||||
|
)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user