<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;This plugin consists of two parts, the HTTPStatus exceptions and the default exception handler. Both of these can be changed easily to fit your own needs.&lt;/p&gt;
&lt;h2&gt;Changing the exception handler&lt;/h2&gt;
&lt;p&gt;This plugin uses &lt;code&gt;rescue_from&lt;/code&gt; to catch all HTTPStatus exceptions and simply calls the &lt;code&gt;http_status_exception&lt;/code&gt; method to handle it. You can reimplement this method in your application controller if you wish to customize the handling of these exceptions.&lt;/p&gt;
&lt;p&gt;This is the default implementation of this method:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
  def http_status_exception(exception)&lt;br /&gt;
    @exception = exception&lt;br /&gt;
    render(:template =&amp;gt; exception.template, :status =&amp;gt; exception.status)&lt;br /&gt;
  rescue ActionView::MissingTemplate&lt;br /&gt;
    head(exception.status)&lt;br /&gt;
  end&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;h2&gt;Altering HTTPStatus::Base&lt;/h2&gt;
&lt;p&gt;All exception classes are automatically generated and based on the &lt;code&gt;HTTPStatus::Base&lt;/code&gt;. You can reopen this class to change its functionality, which in turn will then be available to all exception classes. This can be done by adding a file to your &lt;code&gt;config/initializations&lt;/code&gt; directory:&lt;/p&gt;
&lt;pre&gt;
# Change the path from  which the error page templates are loaded. 
# Default value: 'shared/http_status'

HTTPStatus::Base.template_path = 'layouts/http_status'

# Add a method to all exception classes
class HTTPStatus::Base
  def hello_world
    'Hello world!'
  end
end
&lt;/pre&gt;</body>
  <created-at type="datetime">2008-09-21T01:38:55-07:00</created-at>
  <id type="integer">58505</id>
  <permalink>customization</permalink>
  <repository-id type="integer">54644</repository-id>
  <title>Customization</title>
  <updated-at type="datetime">2008-09-21T01:39:28-07:00</updated-at>
  <user-id type="integer">15870</user-id>
</wiki>
