Skip to content

Support for universal error catcher #192

@kibertoad

Description

@kibertoad

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

wretch("...")
  .anyError((err) => console.log(err))
  .get()

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions