fix rubocop regressions

This commit is contained in:
stve 2016-02-04 13:12:12 -05:00
parent 9def2d016a
commit 19304cc274
2 changed files with 5 additions and 5 deletions

View file

@ -9,7 +9,7 @@ module Instapaper
def access_token(username, password)
response = perform_post_with_unparsed_response('/api/1.1/oauth/access_token', x_auth_username: username, x_auth_password: password, x_auth_mode: 'client_auth')
parsed_response = QLineParser.parse(response)
fail Instapaper::Error::OAuthError, parsed_response['error'] if parsed_response.key?('error')
raise Instapaper::Error::OAuthError, parsed_response['error'] if parsed_response.key?('error')
Instapaper::Credentials.new(parsed_response)
end
end

View file

@ -39,9 +39,9 @@ module Instapaper
return if response.status.ok?
if Instapaper::Error::CODES.include?(response.status.code)
fail Instapaper::Error.from_response(response.status.code, path)
raise Instapaper::Error.from_response(response.status.code, path)
else
fail Instapaper::Error, 'Unknown Error'
raise Instapaper::Error, 'Unknown Error'
end
end
@ -53,10 +53,10 @@ module Instapaper
def fail_if_body_contains_error
return unless parsed.is_a?(Array)
return unless parsed.size > 0
return if parsed.empty?
return unless parsed.first['type'] == 'error'
fail Instapaper::Error.from_response(parsed.first['error_code'], @path)
raise Instapaper::Error.from_response(parsed.first['error_code'], @path)
end
end
end