Permalink
Browse files

Fixed exception handling in the sentry and server.

  • Loading branch information...
niho committed Oct 16, 2011
1 parent f50904c commit bd7e38f3810d80c8fefb2f0e3c6008883a3a9523
Showing with 4 additions and 2 deletions.
  1. +2 −2 lib/auth/sentry.rb
  2. +2 −0 lib/auth/server.rb
View
@@ -14,13 +14,13 @@ def authenticate!(domain=:default)
when :client
@client = Auth.authenticate_client(@request.params['client_id'], @request.params['client_secret'])
unless @client
- raise AuthException, 'Invalid client'
+ raise UnauthorizedClient, 'Invalid client'
end
else
if Auth.authenticate_account(@request.params['username'], @request.params['password'])
@user = User.new(@request.params['username'])
else
- raise AuthException, 'Invalid username or password'
+ raise AccessDenied, 'Invalid username or password'
end
end
end
View
@@ -12,6 +12,8 @@ class Server < Sinatra::Base
set :views, "#{dir}/server/views"
set :public, "#{dir}/server/public"
set :static, true
+ set :raise_errors, true
+ set :show_exceptions, true if development?
helpers do
include Rack::Utils

0 comments on commit bd7e38f

Please sign in to comment.