Permalink
Browse files

Added error handler.

  • Loading branch information...
1 parent 5d842ce commit cab11833d5c69336f0191c8596554aef1fe6f789 @eddanger committed Jan 29, 2009
Showing with 9 additions and 0 deletions.
  1. +9 −0 consumer.rb
View
9 consumer.rb
@@ -38,6 +38,15 @@ class Oauth
end
end
+error do
+ exception = request.env['sinatra.error']
+ warn "%s: %s" % [exception.class, exception.message]
+ warn exception.backtrace.join("\n")
+
+ @error = "Oh my! Something went awry. (" + exception.message + ")"
+ erb :error
+end
+
# index!
get '/' do
erb :index

0 comments on commit cab1183

Please sign in to comment.