Skip to content

Commit

Permalink
fixed APILimitReachedException name
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityblast committed Nov 13, 2010
1 parent ce99254 commit 3bdd58e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/musix_match/api/base.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module MusixMatch
module API
class AuthenticationFailedException < Exception; end
class APILimiReachedException < Exception; end
class APILimitReachedException < Exception; end
class APIKeyNotSpecifiedException < Exception; end

class Base
Expand Down Expand Up @@ -34,7 +34,7 @@ def self.get(method, params={})
end
case parsed_response['message']['header']['status_code']
when 401 then raise AuthenticationFailedException.new('Authentication failed, probably because of a bad API key')
when 402 then raise APILimiReachedException.new('A limit was reached, either you exceeded per hour requests limits or your balance is insufficient')
when 402 then raise APILimitReachedException.new('A limit was reached, either you exceeded per hour requests limits or your balance is insufficient')
end
parsed_response
end
Expand Down
2 changes: 1 addition & 1 deletion spec/api/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
HTTParty.should_receive(:get).with(url).and_return(response)
result = MusixMatch::API::Base.get(method, params)
result.should == parsed_response
end.should raise_error(MusixMatch::API::APILimiReachedException)
end.should raise_error(MusixMatch::API::APILimitReachedException)
end
end

0 comments on commit 3bdd58e

Please sign in to comment.