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

In functional tests, unhandled exception in controller method leads to 200 response instead of 500 #1001

Open
smirnovegorv opened this issue Sep 15, 2016 · 1 comment

Comments

@smirnovegorv
Copy link

When a controller method throws an unhandled exception, under normal circumstances this leads to 500 error page. However if I make request to the same method from the functional test, I get a 200 OK response.

This really breaks my functional testing, as my tests can not catch a bug which can be easily seen if opening the page manually in a browser.

To get my error I need either to use selenium test (which is slow, but it gets same result as a browser) or to wrap controller method into:

try { ... } catch (Exception ex) { error() }

In case of explicit error() call the functional test gets correct 500 return code.

I created a sample webapp, where Application.index() method throws a runtime exception and a functional test checks that its return status is 500:
https://drive.google.com/file/d/0B72ZMlJTpA1VLWxpd0lMWk5JSHM/view?usp=sharing

@Fraserhardy
Copy link
Contributor

Fixed in #1246 needs reviewing and approving.

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

No branches or pull requests

2 participants