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

Fix 1.9 syntax error (with Error fixes) #1094

Merged
merged 9 commits into from
Dec 30, 2019
Merged

Conversation

technoweenie
Copy link
Member

This PR adds fixes some new failing tests added to #1086.

Changing the signature from:

# lib/faraday/error.rb
# Faraday::NilStatusError
-def initialize(_exc, response: nil)
+def initialize(_exc, response = nil)

Is a major change, but it's only used in one spot:

# lib/faraday/response/raise_error.rb
-raise Faraday::NilStatusError, response: response_values(env)
+raise Faraday::NilStatusError, response_values(env)

This PR updates it, and adds a deprecation warning.

>> Faraday::NilStatusError.new(response: {status: 1}).inspect
NOTE: Faraday::NilStatusError#unwrap_resp is deprecated; use  instead. It will be removed in or after version 1.0
Faraday::NilStatusError#unwrap_resp called from /Users/rick/p/faraday/lib/faraday/error.rb:121.
=> "#<Faraday::NilStatusError response={:status=>1}>"

>> Faraday::NilStatusError.new({status: 1}).inspect
=> "#<Faraday::NilStatusError response={:status=>1}>"

For the master branch, and eventually v1.0:

  • Apply updated specs and fixes
  • Ensure all error constructors are consistent
  • Remove deprecation warnings
  • Stop advertising ruby 1.9 support

@technoweenie
Copy link
Member Author

The latest commit also fixes the %i issue reported in #1086 (comment).

@technoweenie technoweenie mentioned this pull request Dec 27, 2019
2 tasks
@BanzaiMan BanzaiMan mentioned this pull request Dec 27, 2019
2 tasks
@technoweenie technoweenie merged commit cbde3d3 into 0.1x Dec 30, 2019
@technoweenie technoweenie deleted the BanzaiMan-patch-1 branch December 30, 2019 01:39
@technoweenie technoweenie mentioned this pull request Dec 30, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants