Skip to content
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

Throw a proper error if negative funds are given to the connect endpoint #1969

LefterisJP opened this issue Jul 26, 2018 · 2 comments


Copy link

Problem Definition

If you provide negative funds to the connect endpoint like below:

http PUT http://localhost:5001/api/1/connections/0x0f114A1E9Db192502E7856309cc899952b3db1ED funds=-10

then an internal server error is thrown

Traceback (most recent call last):
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/flask/", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/flask/", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/flask_restful/", line 480, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/flask/", line 88, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/flask_restful/", line 595, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/webargs/", line 441, in wrapper
    return func(*args, **kwargs)
  File "/home/lefteris/ew/raiden/raiden/api/v1/", line 185, in put
  File "/home/lefteris/ew/raiden/raiden/api/", line 470, in connect
  File "/home/lefteris/ew/raiden/raiden/api/", line 163, in token_network_connect
  File "/home/lefteris/ew/raiden/raiden/", line 108, in connect
    raise ValueError('connecting needs a positive value for `funds`')
ValueError: connecting needs a positive value for `funds`


Return a proper error through the API instead of the internal server error

@LefterisJP LefterisJP added this to the Red Eyes Testnet2 milestone Jul 26, 2018
@LefterisJP LefterisJP self-assigned this Jul 26, 2018
Copy link

@pcppcp does #1959 also fix this?

Copy link
Contributor Author

@hackaugusto no it does not. I am on latest master and just got it. Fix incoming in a few secs.

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

No branches or pull requests

2 participants