plausible icon indicating copy to clipboard operation
plausible copied to clipboard

How to capture fetch errors?

Open toniengelhardt opened this issue 1 year ago • 11 comments

I'm getting a lot of TypeError: Failed to fetch in Sentry from failing Plausible fetch requests:

Screenshot 2024-07-11 at 22 43 22

I tried wrapping the useTrackEvent composable into a try/catch like so:

Screenshot 2024-07-11 at 22 42 52

But the events still get logged and spam Sentry.

Not sure why exactly the requests to the Plausible API fail, but is there a way to properly catch/handle/ignore them?

Might be an upstream issue in plausible-tracker?

toniengelhardt avatar Jul 11 '24 21:07 toniengelhardt