T
TanStack2mo ago
frozen-sapphire

Global "onError" handler

Hello! I'm looking to implement the following logic:
onError: (error) => {
error.data.code === "NOT_FOUND" && notFound({ throw: true });
}
onError: (error) => {
error.data.code === "NOT_FOUND" && notFound({ throw: true });
}
globally. But there isn't a "defaultOnError". How can i do this?
3 Replies
dependent-tan
dependent-tan2mo ago
sounds like something we could add want to create a PR for this?
frozen-sapphire
frozen-sapphireOP2mo ago
I will try to give it a go!! Any caveats I should be aware vs the implementation of “defaultOnCatch”?
dependent-tan
dependent-tan2mo ago
not aware of any let's just try it out and we will see

Did you find this page helpful?