Skip to content

Commit

Permalink
Pass the exception correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyom committed Oct 4, 2019
1 parent 6adf096 commit 2c81ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/faraday/error.rb
Expand Up @@ -85,7 +85,7 @@ def initialize(exc = 'timeout', response = nil)

# Raised by Faraday::Response::RaiseError in case of a nil status in response.
class NilStatusError < ServerError
def initialize(response = nil)
def initialize(_exc, response: nil)
message = 'http status could not be derived from the server response'
super(message, response)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/response/raise_error.rb
Expand Up @@ -29,7 +29,7 @@ def on_complete(env)
when 422
raise Faraday::UnprocessableEntityError, response_values(env)
when nil
raise Faraday::NilStatusError, response_values(env)
raise Faraday::NilStatusError, response: response_values(env)
when ClientErrorStatuses
raise Faraday::ClientError, response_values(env)
when ServerErrorStatuses
Expand Down

0 comments on commit 2c81ed6

Please sign in to comment.