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 client fetch_token
throwing NoMethodError
when raise_errors is set to false
#460
Fix client fetch_token
throwing NoMethodError
when raise_errors is set to false
#460
Conversation
…s set to false The problem occurs when the identifier service is unreachable and we are passing the :raise_errors option set to false. The `fetch_token` method throws `NoMethodError` while trying to perform the following code: `response.parsed.merge(access_token_opts)` This happens because the `response.parsed` is `nil`.
Related to opened issue: #459 |
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent. If you have time to think about a solution, please do! Otherwise one of the maintainers may look at this eventually. We're all short on time, and long on commitments, so this project is primarily running on community effort.
… should return nil
Hello @pboling, I was really short on time to contribute to this PR. But here you go. My suggestion to this is to return nil when there is now way we can build the access token, which is the saying the same that Cheers mate! |
Thanks @joaolrpaulo !! |
Hello @pboling, is there a possibility to add this to a new patch release in order for we to use it ? |
@joaolrpaulo it would have to be backported to the 1-4-stable branch, as a second PR. |
I will do it in the next few days 🙏 |
The problem occurs when the identifier service is unreachable and we are passing the :raise_errors option set to false.
The
fetch_token
method throwsNoMethodError
while trying to perform the following code:response.parsed.merge(access_token_opts)
This happens because the
response.parsed
isnil
.