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
Currently it does not seem to be possible to specify one catcher for all errors, which may be preferable in case there is no logic specific to particular errors, but just one way to handle them all - e. g. passthrough to an external system, such as BugSnag or Sentry.
It is sorta kinda doable via .get().res().catch() now, but this can only be applied per request, so it doesn't work as a system-wide (or a client-wide) hook.
The text was updated successfully, but these errors were encountered:
Currently it does not seem to be possible to specify one catcher for all errors,
Thanks for your feedback! This is definitely a missing feature.
I just released v2.6.0 which implements a fallback catcher to handle this use case:
wretch(url).catcher(404,err=>redirect("/routes/notfound",err.message)).catcher(500,err=>flashMessage("internal.server.error"))// this fallback will trigger for any error except if already caught by other means (like above for 404s and 505s).catcherFallback(err=>{log("Uncaught error:",err)throwerr})
Currently it does not seem to be possible to specify one catcher for all errors, which may be preferable in case there is no logic specific to particular errors, but just one way to handle them all - e. g. passthrough to an external system, such as BugSnag or Sentry.
Would be great to have something like
It is sorta kinda doable via
.get().res().catch()
now, but this can only be applied per request, so it doesn't work as a system-wide (or a client-wide) hook.The text was updated successfully, but these errors were encountered: