Actions that fail to perform as expected throw exceptions. These exceptions
can either be rescued for the public view (with a nice user-friendly
explanation) or for the developers view (with tons of debugging
information). The developers view is already implemented by the Action
Controller, but the public view should be tailored to your specific
application.
The default behavior for public exceptions is to render a static html file
with the name of the error code thrown. If no such file exists, an empty
response is sent with the correct status code.
You can override what constitutes a local request by overriding the local_request? method in your own
controller. Custom rescue behavior is achieved by overriding the rescue_action_in_public and rescue_action_locally methods.