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

Unable to construct ShopifyErrorResponseException #36

Open
nata7che opened this issue Apr 6, 2020 · 4 comments
Open

Unable to construct ShopifyErrorResponseException #36

nata7che opened this issue Apr 6, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@nata7che
Copy link

nata7che commented Apr 6, 2020

When performing a GET method and getting a bad access token error, the sdk is unable to construct the ShopifyErrorResponseException object:

JsonMappingException: Can not construct instance of com.shopify.model.ShopifyErrors: no String-argument constructor/factory method to deserialize from String value ('[API] Invalid API key or access token (unrecognized login or wrong password)')
 at [Source: {"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}; line: 1, column: 11] (through reference chain: com.shopify.model.ShopifyErrorsRoot["errors"])
@nata7che
Copy link
Author

nata7che commented Apr 6, 2020

BTW this also happens for:

Could not parse error message from shopify for response body: {"errors":"Checkout System disabled"}
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.shopify.model.ShopifyErrors: no String-argument constructor/factory method to deserialize from String value ('Checkout System disabled')
 at [Source: {"errors":"Checkout System disabled"}; line: 1, column: 11] (through reference chain: com.shopify.model.ShopifyErrorsRoot["errors"])

@ryankazokas
Copy link
Member

Yeah @nata7che . The Shopify errors that they throw on their REST API aren't formatted in any certain way. We've added what we needed to handle around certain field errors and bubbling up everything else. Unfortunately, i haven't seen anything myself in their documentation that we'd be able to predict the format of the errors, but definitely open to hearing any suggestions on better ways of handling this.

@ryankazokas ryankazokas added the help wanted Extra attention is needed label Apr 6, 2020
@brownac
Copy link
Contributor

brownac commented Apr 9, 2020

I want to add that I'm also seeing something similar for Shopify 402 errors:

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance ofcom.shopify.model.ShopifyErrors(although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Unavailable Shop')

@blueoo
Copy link

blueoo commented Jul 30, 2020

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.shopify.model.ShopifyErrors (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Unavailable Shop')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants