MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 278 forks source link

Error response undefined #474

Closed Haideralee closed 3 years ago

Haideralee commented 3 years ago

Hi, I am trying to create a customer and if a customer already existing then I am expecting 'error.response.body' to have error detail but it's sending an unexpected and inconsistent response. sometimes it's given me a complete proper error and sometimes gives an incomplete error where the response undefined.

I am attaching an errors screenshot

incomplete error screenshot shopify-error-1

complete error screenshot shopify-error-2

lpinca commented 3 years ago

Not all errors have the response property. Sometimes the error occurs before the HTTP response is received.

Haideralee commented 3 years ago

I understand not all errors have response property but errors have some legit detail about the error right ? if you look 1 screenshot there no clue why and what kind of error was it.

and it's the same endpoint I was calling with same credentials but it's send me sometimes proper error detail and sometimes it's just send me wired error object.

lpinca commented 3 years ago

If you google EAI_AGAIN you'll see that it's a DNS lookup timeout error. There is also a clear distinction between HTTP errors (HTTPError) and generic request errors (RequestError). Errors are handled by got, the HTTP library used by shopify-api-node.

lpinca commented 3 years ago

I'm closing this as answered. Discussion can continue if needed.