<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,10 +21,7 @@ Bugs
 
 == Usage
 
-When a rule fails a Doorman::Unauthorized error is raised. The error
-can then be caught in ApplicationController#rescue_action_in_public.
-
-==== Controllers
+=== Controllers
 
   class Admin::ArticlesController &lt; AdminController
     allow :role =&gt; :admin
@@ -42,7 +39,7 @@ can then be caught in ApplicationController#rescue_action_in_public.
   deny :host =&gt; 'denied.example.org'
   deny :user_agent =&gt; /MSIE/                # request.user_agent =~ Regexp.new(/MSIE/)
 
-==== Views
+=== Views
 
 All rules can be used in views.
 
@@ -54,6 +51,25 @@ All rules can be used in views.
     &lt;h1&gt;Allowed&lt;/h1&gt;
   &lt;% end %&gt;
 
+=== Unauthorized
+
+When a rule fails a Doorman::Unauthorized error is raised. The error
+can be caught in ApplicationController#rescue_action_in_public.
+
+  class ApplicationController &lt; ActionController::Base
+    private
+    def rescue_action_in_public(exception)
+      case exception
+      when Doorman::InvalidRule
+        render :text =&gt; 'Invalid Rule', :status =&gt; '500 Internal Server Error'
+      when Doorman::Unauthorized
+        render :text =&gt; 'Unauthorized', :status =&gt; '401 Unauthorized'
+      else
+        super(exception)
+      end
+    end
+  end
+
 == TODO
 
 === Rule inheritance</diff>
      <filename>README.rdoc</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>851b783fe76e1c2a6bb5b7beebe83687f701ebad</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Burks</name>
    <email>jeremy.burks@gmail.com</email>
  </author>
  <url>http://github.com/jrun/rails_doorman/commit/cd62f962ec8fd246039283f5d7d423037aaac5fe</url>
  <id>cd62f962ec8fd246039283f5d7d423037aaac5fe</id>
  <committed-date>2009-05-25T07:35:50-07:00</committed-date>
  <authored-date>2009-05-25T07:35:50-07:00</authored-date>
  <message>more readme</message>
  <tree>0ead68374fc7f9dec7c2b833b83fda39f743197a</tree>
  <committer>
    <name>Jeremy Burks</name>
    <email>jeremy.burks@gmail.com</email>
  </committer>
</commit>
