Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated Net::HTTPServerException with Net::HTTPClientException #395

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def construct_url(server, path)
def with_http_rescue(*)
response = yield
if response.respond_to?(:code)
# handle non 200 error codes, they are not raised as Net::HTTPServerException
# handle non 200 error codes, they are not raised as Net::HTTPClientException
handle_http_error_code(response.code) if response.code.to_i >= 300
end
response
rescue Net::HTTPServerException => e
rescue Net::HTTPClientException => e
Chef::Log.error e
handle_http_error_code(e.response.code)
end
Expand Down