You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a lot of failed to fetch errors. What I think happens when a request fails due to a poor network connection is Sentry will log that network error, the act of logging that network error causes another failed to fetch error. I think Sentry must store all these errors up locally so when the user eventually restores their connection my logs get bamboozled with thousands of Failed to fetch errors, instantly depleting my error capacity.
I'm adding work arounds in my code to not log errors that are a result of not being able to report an error. But here's a little snippit that will show you the URL that failed to fetch in the Sentry error logs.
varoriginalFetch=window.fetchwindow.fetch=function(resource){returnoriginalFetch.apply(this,arguments).catch(function(error){if(error.message=='Failed to fetch'){varnewError=newTypeError(`Failed to fetch (${String(resource)})`)newError.resource=String(resource)thrownewError}throwerror})}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I get a lot of failed to fetch errors. What I think happens when a request fails due to a poor network connection is Sentry will log that network error, the act of logging that network error causes another failed to fetch error. I think Sentry must store all these errors up locally so when the user eventually restores their connection my logs get bamboozled with thousands of Failed to fetch errors, instantly depleting my error capacity.
I'm adding work arounds in my code to not log errors that are a result of not being able to report an error. But here's a little snippit that will show you the URL that failed to fetch in the Sentry error logs.
Logs will now show 'Failed to fetch (https://a-url-that-could-not-be.reached)', giving you some visibility of what's going on.
Beta Was this translation helpful? Give feedback.
All reactions