Skip to content

Commit

Permalink
I think I have the response error handling right this time
Browse files Browse the repository at this point in the history
  • Loading branch information
rwilcox committed Sep 9, 2010
1 parent 116451f commit d26fd2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/google_spreadsheet.rb
Expand Up @@ -337,7 +337,7 @@ def check_for_errors(response)
raise AuthSubTokenError, "Token invalid, HTML returned was #{response.body}"
end

unless response == Net::HTTPSuccess
unless response.code =~ /20\d/ # 200 series == success
raise Net::HTTPBadResponse,
"HTTP Error Code: #{response.code}\nbody: #{response.body}"
end
Expand Down

0 comments on commit d26fd2e

Please sign in to comment.