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

Add Graphlient::Errors::ConnectionFailedError #68

Merged
merged 3 commits into from
Nov 13, 2019
Merged

Add Graphlient::Errors::ConnectionFailedError #68

merged 3 commits into from
Nov 13, 2019

Commits on Nov 12, 2019

  1. Add Graphlient::Errors::ConnectionFailedError

    This is essentially #59 with test.
    
    Whenever there is an `Errno::ECONNREFUSED error`, Faraday wraps it in a
    `Faraday::ConnectionFailed` error. Since it inherits `Faraday::ClientError`
    without a response (see errors/faraday_server_error.rb), the code would return
    a `NoMethodError: undefined method []' for nil:NilClass` error.
    
    So basically the fix is to rescue `Faraday::ConnectionFailed` before rescuing
    `Faraday::ClientError` so that we can raise a more meaningful error.
    
    Result:
    ```
    Graphlient::Errors::ConnectionFailedError: Failed to open TCP connection to
    localhost:3000 (Connection refused - connect(2) for "localhost" port 3000)
    ```
    neroleung committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    fd349c8 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2019

  1. Configuration menu
    Copy the full SHA
    5ede1e8 View commit details
    Browse the repository at this point in the history
  2. Update README.md

    neroleung committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    8496e96 View commit details
    Browse the repository at this point in the history