Skip to content

Commit 41bacfb

Browse files
committed
Raise a valid error
Since at least ruby 2.0.0 Net::HTTPServerError requires 3 arguments https://github.com/ruby/ruby/blob/v2_0_0_0/lib/net/http/response.rb#L75 The first one being `http_version` which response has https://github.com/ruby/ruby/blob/ruby_2_0_0/lib/net/http/response.rb#L87
1 parent f603b98 commit 41bacfb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/messagebird/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def request(method, path, params={})
5151
when 200, 201, 204, 401, 404, 405, 422
5252
json = JSON.parse(response.body)
5353
else
54-
raise Net::HTTPServerError.new 'Unknown response from server', response
54+
raise Net::HTTPServerError.new response.http_version, 'Unknown response from server', response
5555
end
5656

5757
# If the request returned errors, create Error objects and raise.

0 commit comments

Comments
 (0)