diff --git a/lib/faraday/error.rb b/lib/faraday/error.rb index 18241a473..2152d6603 100644 --- a/lib/faraday/error.rb +++ b/lib/faraday/error.rb @@ -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 diff --git a/lib/faraday/response/raise_error.rb b/lib/faraday/response/raise_error.rb index 4ac8b15c7..3425d1a60 100644 --- a/lib/faraday/response/raise_error.rb +++ b/lib/faraday/response/raise_error.rb @@ -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