rails/rails — pull request #8958 by balexand (2013-01-16 01:07:09+00:00)
Title: Strong parameters exception handling

When `ActionController::ParameterMissing` is raised, the following occurs:

* In development, the following error message is rendered to the response body: `"Required parameter missing: foo"`. But no backtrace is displayed in the browser or the logs.
* In production, the same error messages is rendered to the response body. This exposes the user to confusing developer-speak. Also, exception notifiers won't notify the developer of the issue since the exception is eaten by `rescue_from`.

After this pull-request, the following will occur:

* In development, the Rails exception page will be rendered, complete with backtrace and code snippet showing offending line.
* In production, the appropriate error page is rendered.

I didn't change the response code; it's still `400`. Since a default Rails app doesn't include a `400.html` file, an empty response body will be rendered by default in production.

Possibly we could change the response code to `422`? It seems like an appropriate code and Rails generates a `422.html` by default.

Thanks!