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

Handle response objects of instance String for API errors #509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kraju3
Copy link
Contributor

@kraju3 kraju3 commented Jan 10, 2025

Description

Due to unexpected errors such as Bad Gateway, the response object is of Instance string, while trying to fetch the provider_error we return a Ruby error of
undefined method fetch' for "Bad Gateway":String`

This PR addresses the type before parsing the provider_error property

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Copy link
Contributor

@nickbair-nylas nickbair-nylas left a comment

Choose a reason for hiding this comment

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

LGTM, worth adding a test case for this?

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.

undefined method `fetch' for an instance of String: nylas/handler/http_client.rb in throw_error
2 participants