Permalink
Browse files

Fix error naming

  • Loading branch information...
1 parent a9d2d67 commit 432ae491dd4210a6d077f689afaaf8a8374f247c Jesse Stuart committed Oct 3, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/omniauth/strategies/tent.rb
@@ -10,6 +10,7 @@ class Tent
Error = Class.new(StandardError)
AppCreateFailure = Class.new(Error)
+ AppAuthorizationCreateFailure = Class.new(Error)
StateMissmatchError = Class.new(Error)
option :get_app, lambda { |entity| }
@@ -37,6 +38,8 @@ def request_phase
end
rescue AppCreateFailure => e
fail!(:app_create_failure, e)
+ rescue AppAuthorizationCreateFailure => e
+ fail!(:app_authorization_create_failure, e)
rescue StateMissmatchError => e
fail!(:state_missmatch)
end
@@ -130,7 +133,7 @@ def create_app_authorization!
:mac_key => get_app[:mac_key],
:mac_algorithm => get_app[:mac_algorithm])
res = client.app.authorization.create(get_app[:id], :code => request.params['code'])
- raise AppCreateFailure.new(res.body) if res.body.kind_of?(String)
+ raise AppAuthorizationCreateFailure.new(res.body) if res.body.kind_of?(String)
@app_authorization = Hashie::Mash.new(res.body)
end

0 comments on commit 432ae49

Please sign in to comment.