You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am using 12.4.0 version of this gem.
Every once in a while, I get a 500 error from what should be a valid REST request to Shopify's API. The request retrieves metafields from a product. The reason I know this request is valid, is because if I run the same script on 500 products multiple times, it will sometimes make it all the way through, other times fail on a random product, each time a different product.
I understand that no server has perfect uptime (assuming that is the problem). However,
your gem is producing the errors pretty deep in it's libraries, so I am not given a clean way to do any error management with beginrescue or the like. Below is the response I am given:
/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/common.rb:216:in parse': unexpected token at '<!-- (JSON::ParserError)`
Then below that is a whole bunch of html describing a 500 error page which says "There was a problem loading this website". I omit it here for brevity. Then the backtrace shows all of this, before getting into my app:
What seems obvious here is that the library is not catching the 500 error, and tries to parse an html error-page response as if it were JSON (which it isn't). I need a way to catch this error, and know what kind it is (internal server error? Over API bucket limit? Invalid request?).
The text was updated successfully, but these errors were encountered:
Hi,
I am using 12.4.0 version of this gem.
Every once in a while, I get a 500 error from what should be a valid REST request to Shopify's API. The request retrieves metafields from a product. The reason I know this request is valid, is because if I run the same script on 500 products multiple times, it will sometimes make it all the way through, other times fail on a random product, each time a different product.
I understand that no server has perfect uptime (assuming that is the problem). However,
your gem is producing the errors pretty deep in it's libraries, so I am not given a clean way to do any error management with
begin
rescue
or the like. Below is the response I am given:/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/common.rb:216:in
parse': unexpected token at '<!-- (JSON::ParserError)`Then below that is a whole bunch of html describing a 500 error page which says "There was a problem loading this website". I omit it here for brevity. Then the backtrace shows all of this, before getting into my app:
/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/common.rb:216:in
parse'/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/json-2.6.3/lib/json/common.rb:216:in
parse' /home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/shopify_api-12.4.0/lib/shopify_api/clients/http_client.rb:51:in
request'/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sorbet-runtime-0.5.10672/lib/types/private/methods/call_validation_2_7.rb:106:in
bind_call' /home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sorbet-runtime-0.5.10672/lib/types/private/methods/call_validation_2_7.rb:106:in
block in create_validator_method_fast1'/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/shopify_api-12.4.0/lib/shopify_api/clients/rest/admin.rb:25:in
get' /home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sorbet-runtime-0.5.10672/lib/types/private/methods/call_validation.rb:153:in
bind_call'/home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sorbet-runtime-0.5.10672/lib/types/private/methods/call_validation.rb:153:in
validate_call_skip_block_type' /home/colinbrogan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sorbet-runtime-0.5.10672/lib/types/private/methods/call_validation.rb:95:in
block in create_validator_slow_skip_block_type'`
What seems obvious here is that the library is not catching the 500 error, and tries to parse an html error-page response as if it were JSON (which it isn't). I need a way to catch this error, and know what kind it is (internal server error? Over API bucket limit? Invalid request?).
The text was updated successfully, but these errors were encountered: