Closed istankovic closed 3 years ago
Ah, thanks for raising this. My first idea to fix this is to catch the KeyError
and return a BlockNotFound
error with the error message. So something like:
try:
block_identifier = params[0]
msg = f"Block with id: {block_identifier!r} not found."
except KeyError:
msg = params['error'].get('message')
raise BlockNotFound(msg)
We may also need to do similar checks with the other methods that raise errors if the result is none, like get_block, get_uncle_count, get_uncle_by_block, etc. Full list of RPC methods that raise is here.
pip freeze
outputWhat was wrong?
We ran into the following exception when trying to use Raiden with an openethereum node:
It seems like
raise_block_not_found
gets an unexpected argument (it gets the response object):