-
Notifications
You must be signed in to change notification settings - Fork 474
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 JSON::ParserError when http response is HTML and raise ShopifyAPI::Errors::HttpResponseError #1113
Conversation
Nice! I believe this would fix the following: |
@kaarelss is there any idea? how much time it will take to fix it? |
@vishals-vebuin we're waiting on someone from Shopify to approve. As far as I can tell, the last community PR they interacted with was from October 20th, 2022. |
Thanks @ClaytonPassmore Will do. |
b03afc8
to
fba93bc
Compare
Co-authored-by: Clayton Passmore <[email protected]>
@kaarelss - Do you mind fixing that linting issue on your end, I tried doing it with GitHub's editor here but it added a trailing whitespace 🤕 Would love to get this out for our release here in the next day or two, thank you for your contributions! 🎉 |
Done |
…API::Errors::HttpResponseError (Shopify#1113) * Handle JSON::ParserError when http response is html * Added line in changelog * Update lib/shopify_api/clients/http_client.rb Co-authored-by: Clayton Passmore <[email protected]> * Update lib/shopify_api/clients/http_client.rb rubocop * Removes trailing whitespace --------- Co-authored-by: Nelson <[email protected]> Co-authored-by: Clayton Passmore <[email protected]>
Handle
JSON::ParserError
when response is HTML and pass response body toShopifyAPI::Clients::HttpResponse
because it accepts body also as string.Description
Fixes #1091
Fixed #1107
Please, include a summary of what the PR is for:
JSON::ParserError
is thrown. So rescuingJSON::ParserError
would raiseShopifyAPI::Errors::HttpResponseError
and add response code.How has this been tested?
All tests passed as well as new test is included for this new functionality:
test_json_parser_error
inhttp_client_test.rb
Checklist: