Permalink
Browse files

let exceptions bubble up

👊 sinatra in the throat
  • Loading branch information...
1 parent 5aefdfd commit 125d38b450a0e2448baaa5a04d56b0e496587773 @sr sr committed Jul 12, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/sinatra/auth/github.rb
@@ -10,13 +10,19 @@ module Github
# Simple way to serve an image early in the stack and not get blocked by
# application level before filters
class AccessDenied < Sinatra::Base
+ enable :raise_errors
+ disable :show_exceptions
+
get '/_images/securocat.png' do
send_file(File.join(File.dirname(__FILE__), "views", "securocat.png"))
end
end
# The default failure application, this is overridable from the extension config
class BadAuthentication < Sinatra::Base
+ enable :raise_errors
+ disable :show_exceptions
+
helpers do
def unauthorized_template
@unauthenticated_template ||= File.read(File.join(File.dirname(__FILE__), "views", "401.html"))

0 comments on commit 125d38b

Please sign in to comment.