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

ValueError when missing hatchrate #237

Closed
pawelmhm opened this issue Jan 27, 2015 · 4 comments
Closed

ValueError when missing hatchrate #237

pawelmhm opened this issue Jan 27, 2015 · 4 comments
Labels
bug non-critical stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it web interface

Comments

@pawelmhm
Copy link

Not a big deal, but if you forget to specify hatch_rate in web interface you'll get ugly exception in logs, flask app could check for blank values in form and return some friendly error message to client

[2015-01-27 15:16:56,474] pawel-All-Series/ERROR/stderr: Traceback (most recent call last):
[2015-01-27 15:16:56,474] pawel-All-Series/ERROR/stderr: File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 508, in handle_one_response
[2015-01-27 15:16:56,474] pawel-All-Series/ERROR/stderr: self.run_application()
[2015-01-27 15:16:56,474] pawel-All-Series/ERROR/stderr: File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 494, in run_application
[2015-01-27 15:16:56,474] pawel-All-Series/ERROR/stderr: self.result = self.application(self.environ, self.start_response)
[2015-01-27 15:16:56,474] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1903, in __call__
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: return self.wsgi_app(environ, start_response)
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1887, in wsgi_app
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: response = self.make_response(self.handle_exception(e))
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1465, in handle_exception
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: reraise(exc_type, exc_value, tb)
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1884, in wsgi_app
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: response = self.full_dispatch_request()
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1539, in full_dispatch_request
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: rv = self.handle_user_exception(e)
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1443, in handle_user_exception
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: reraise(exc_type, exc_value, tb)
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1537, in full_dispatch_request
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: rv = self.dispatch_request()
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/home/pawel/py/flask/flask/app.py", line 1523, in dispatch_request
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: return self.view_functions[rule.endpoint](**req.view_args)
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: File "/usr/local/lib/python2.7/dist-packages/locust/web.py", line 50, in swarm
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: hatch_rate = float(request.form["hatch_rate"])
[2015-01-27 15:16:56,555] pawel-All-Series/ERROR/stderr: ValueError: could not convert string to float:
[2015-01-27 15:16:56,559] pawel-All-Series/ERROR/stderr: {'CONTENT_LENGTH': '27',

Overall locust is great though.

@mejibyte
Copy link

mejibyte commented Dec 3, 2020

I was just hit with this issue. Spent a long time debugging only to realize I had just left hatch rate blank in the form. Showing a friendlier error on the UI would be a great user experience improvement, especially for Locust newcomers.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Apr 11, 2021
@cyberw cyberw removed the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Apr 11, 2021
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Jun 11, 2021
@github-actions
Copy link

This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug non-critical stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it web interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants