-
Notifications
You must be signed in to change notification settings - Fork 43
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
NoMethodError in FaradayServerError #51
Comments
Try writing a spec that reproduces the problem? |
e = Faraday::ClientError.new(nil) |
In which scenario does this actually happen? What's the stack? The code should be fixed either way. Appreciate a pull request. |
The thing is I don't know. If it'll be fixed I can tell you.
I can't open one right now. but
should fix it |
Looks like we run into a case where |
If someone wants to just PR a defensive implementation for |
It's probably the case that the request timed out and the client threw an error without a response object since there's nothing you could assign to the exception when the request didn't go through. |
On that note, is there a way to pass options to Faraday, e.g. to increase the standard request time out duration? I find myself having to query an API that requires more than the default 30s to generate a response, so raising that would be nice. |
I believe this will work (haven't tested) Graphlient::Client.new('http://test-graphql.biz/graphql') do |client|
client.http do |h|
h.connection do |c|
c.options.timeout = 30
end
end
end If it does, please add to docs? We could also expose http options, I wouldn't mind supporting something like Graphlient::Client.new('http://test-graphql.biz/graphql', http: { connection: { timeout: 30 } }) |
Closed via #68. |
Hi,
We've encounter a situation where we get
undefined method `[]' for nil:NilClass in
graphlient-0.3.3/lib/graphlient/errors/faraday_server_error.rb:7
This is very frustrating because we don't know what is the error behind it
We think that changing to
@response = inner_exception.response.try(:[],:body)
@status_code = inner_exception.response.try(:[],:status)
will fix it
The text was updated successfully, but these errors were encountered: