Skip to content

Fetch errors provide very little info #4146

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

Closed
4 of 9 tasks
rchl opened this issue Nov 11, 2021 · 9 comments
Closed
4 of 9 tasks

Fetch errors provide very little info #4146

rchl opened this issue Nov 11, 2021 · 9 comments

Comments

@rchl
Copy link
Contributor

rchl commented Nov 11, 2021

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

6.14.1

Description

When there is a failure to make a fetch request, the errors reported have no information that would allow me to know what request was attempted. The breadcrumb integration saves the day a little bit because I can look for errors in it but it's not solving the issue 100% since with lazy loading the breadcrumbs might be missing.

Would it be possible to provide more information in cases when fetch requests fail?

A typical event for those kind of errors is a TypeError: failed to fetch exception, for example, with an exception message that can differ per browser and even locale so it's hard to ignore it just based on that.

Screenshot 2021-11-11 at 15 51 48

I believe that Sentry wraps the fetch API so I think it is in a position to provide more information in that case.

To clarify, I'm talking about when request has failed to be dispatched, not when the request finishes with an error code (that doesn't report a Sentry event normally). So for example when the URL is blocked through the Developer tools "block url" functionality (easy to test with).

@AbhiPrasad
Copy link
Member

Thanks for raising an issue. We agree that failed to fetch errors could be better. I'm backlogging this for the team, but in the mean time, contributions and PRs to address this are welcome!

@SofienM
Copy link

SofienM commented May 20, 2022

Having the same pb as on May 2022. Any news on this issue ?

@TheDuckGoesQuark
Copy link

ditto

@AbhiPrasad
Copy link
Member

Hey folks. We’ve started to take a look at this. Could you please leave feedback in #5334?

In particular we would like feedback about what you would expect in this error. What kind of information would help debug this better?

@frnsys
Copy link

frnsys commented Jul 26, 2022

For me, any information about why it failed to fetch--the server error code, or if it's CORS-related, for example. thank you!

@JavierMartinz
Copy link

Same here... I'd like to improve the logged info or skip these errors from being logged, as they fill our errors/transactions quota

@s-ashwin
Copy link

Any informattion regarding the failed request or even the status code might be helpful in my case

@lforst
Copy link
Member

lforst commented Feb 14, 2023

@s-ashwin We recently added the HttpClient integration that should collect that stuff and report it. It's currently not part of the default integrations so you have to add it manually.

@mydea
Copy link
Member

mydea commented Jul 26, 2023

As a matter of cleaning up issues, I am closing this as this can be done with the HttpClient integration now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants