Dealing with Network errors in Apollo Client

Hey folks,

we are running our app in production for 2 months+ already, and we are observing a many of different Apollo Client HTTP/Network errors in Sentry. We are unable to replicate them and not sure what to do with them. It seems to me that some should be retried, others should be ignored, but would love if someone could share their thoughts.

Here’s a list of all the network error messages caught by our Error Link:

  1. Unexpected token < in JSON at position 2
  2. Load failed
  3. JSON Parse error: Unrecognized token ‘<’
  4. Response not successful: Received status code 400
  5. Failed to fetch
  6. NetworkError when attempting to fetch resource.
  7. JSON.parse: unexpected character at line 1 column 2 of the JSON data
  8. request to <our api url> failed, reason: read ECONNRESET
  9. cannot parse response
  10. The network connection was lost.
  11. canceled
  12. The request timed out.
  13. The operation couldn’t be completed. Protocol error
1 Like

:wave: I’m just adding a related issue the Apollo Client team is looking into for reference to this post: