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 NoAMethodError in FaradayServerError #52

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/graphlient/errors/faraday_server_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class FaradayServerError < ServerError
def initialize(inner_exception)
super(inner_exception.message, inner_exception)
@inner_exception = inner_exception
@response = inner_exception.response[:body]
@status_code = inner_exception.response[:status]
@response = inner_exception.response.try(:[],:body)
@status_code = inner_exception.response.try(:[],:status)
Copy link
Collaborator

@yuki24 yuki24 Oct 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #try method is a method defined by ActiveSupport and Graphlient doesn't depend on it.

end
end
end
Expand Down