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
Hello, I got an error when deleting a charge. It appears that the request to cancel works, but the parse_json/2 function in the Response module throws an error.
Shopify.RecurringApplicationCharge.delete(session, 1234)
> no case clause matching: {:error, :invalid, 0}
(shopify) lib/shopify/response.ex:24: Shopify.Response.parse_json/2
(shopify) lib/shopify/response.ex:12: Shopify.Response.new/3
It appears that parse_json is being called with the following arguments: parse_json(nil, "")
You'll notice the result there is the same as my error above. I'm happy to take a stab at a PR for this, but I'm curious how we might want to handle the response here?
There's no response body from Shopify according to their docs. This seems inconsistent with other DELETE calls where the response body is an empty JSON object.
The text was updated successfully, but these errors were encountered:
The API is full of inconsistencies, so I am not really surprised ;)
I guess we could just pattern match here and replace empty strings with an empty json object.
Hello, I got an error when deleting a charge. It appears that the request to cancel works, but the
parse_json/2
function in theResponse
module throws an error.It appears that
parse_json
is being called with the following arguments:parse_json(nil, "")
nil
being the resource, and""
is the body.This results in the following being called here:
You'll notice the result there is the same as my error above. I'm happy to take a stab at a PR for this, but I'm curious how we might want to handle the response here?
There's no response body from Shopify according to their docs. This seems inconsistent with other DELETE calls where the response body is an empty JSON object.
The text was updated successfully, but these errors were encountered: