This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 387
Error details not accessible for HTTP client #237
Comments
Hey @Boxonical, thanks for the very detailed issue! You raise a good point, we'll look into making that error information available in the response. |
#250 is facing the same issue and returns a 400 against the script_tags api |
Another issue #220 is similarly facing an obfuscated error message. |
6 tasks
Any news on how we can obtain a better error message? "statusText": "Unprocessable Entity" is simply too vague and hard to debug. |
Try looking at the response body in the catch error - like this: |
@customerhub that works! is that included in the docs somewhere? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue summary
Shopify error code / details are not accessible in the .catch() method of HTTP clients, making debugging difficult & error handling impossible.
Sample HTTP response from Shopify:
The error object in .catch():
Expected behavior
Perhaps a more meaningful error:
Actual behavior
[object Object]
in error message comes from:https://github.com/Shopify/shopify-node-api/blob/0ee4f8adb6260b552d447b8e03d8f34067a34e9a/src/clients/http_client/http_client.ts#L236-L238
Error thrown here:
https://github.com/Shopify/shopify-node-api/blob/0ee4f8adb6260b552d447b8e03d8f34067a34e9a/src/clients/http_client/http_client.ts#L251-L256
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: