Permalink
Browse files

Doc for error(500) { }

  • Loading branch information...
1 parent 63fd773 commit 59e797e99775c5abc7493bf24b9027de3ccad96d @sr sr committed Dec 23, 2009
Showing with 16 additions and 0 deletions.
  1. +16 −0 README.rdoc
View
16 README.rdoc
@@ -406,6 +406,22 @@ You get this:
So what happened was... something bad
+Alternatively, you can install error handler for a status code:
+
+ error 403 do
+ 'Access forbidden'
+ end
+
+ get '/secret' do
+ 403
+ end
+
+Or a range:
+
+ error 400..510 do
+ 'Boom'
+ end
+
Sinatra installs special <tt>not_found</tt> and <tt>error</tt> handlers when
running under the development environment.

0 comments on commit 59e797e

Please sign in to comment.