New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal server error on REST endpoint `/events/tokens/` for a non-existing token #1224

Closed
pcppcp opened this Issue Jan 25, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@pcppcp
Contributor

pcppcp commented Jan 25, 2018

Problem Definition

For REST request that queries /events/tokens/<nonexisting_token_addr> an internal server error will be returned.

Solution

Return either E404 or an empty list

Tasklist

  • catch KeyError exception and return appropriate response if raised
  • implement test that queries events of a non-existing token

System Description

0.2.0+git.r4c1acbe3

Traceback (most recent call last):
  File "/home/xoza/.pyenv/versions/test_354/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/xoza/.pyenv/versions/test_354/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/xoza/.pyenv/versions/test_354/lib/python3.5/site-packages/flask_restful/__init__.py", line 480, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/xoza/.pyenv/versions/test_354/lib/python3.5/site-packages/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/xoza/.pyenv/versions/test_354/lib/python3.5/site-packages/flask_restful/__init__.py", line 595, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/xoza/.pyenv/versions/test_354/lib/python3.5/site-packages/webargs/core.py", line 441, in wrapper
    return func(*args, **kwargs)
  File "/home/xoza/src/raiden/raiden/api/v1/resources.py", line 102, in get
    to_block=to_block,
  File "/home/xoza/src/raiden/raiden/api/rest.py", line 446, in get_token_network_events
    token_address, from_block, to_block
  File "/home/xoza/src/raiden/raiden/api/python.py", line 645, in get_token_network_events
    graph = self.raiden.token_to_channelgraph[token_address]
KeyError: b'po\xfe(\x0b:\xb3\x07\x19!*\x8boJ\x1b*\xc0\x0f\x08a'

@palango palango added this to the Next minor release milestone Feb 1, 2018

palango added a commit to palango/raiden that referenced this issue Feb 9, 2018

@palango palango self-assigned this Feb 12, 2018

palango added a commit to palango/raiden that referenced this issue Feb 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment