TanStackT
TanStack6mo ago
5 replies
static-pink

Global "onError" handler

Hello!

I'm looking to implement the following logic:

  onError: (error) => {
    error.data.code === "NOT_FOUND" && notFound({ throw: true });
  }


globally. But there isn't a "defaultOnError". How can i do this?
Was this page helpful?