Skip to content

Commit

Permalink
fix: default error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Feb 17, 2024
1 parent f1079cb commit 5f2532e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/app/src/lib/trpc/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ export default function TrpcProvider({ children }: { children: React.ReactNode }
},
}),
mutationCache: new MutationCache({
onError: (error, query) => {
if (testNoDefaultErrorHandling(query)) return
onError: (error, _v, _c, mutation) => {
if (testNoDefaultErrorHandling(mutation)) return
handleMutationError(error as TRPCClientErrorLike<AppRouter>, dictionary, router)
},
}),
})
)

const [trpcClient] = useState(() =>
trpc.createClient({
transformer: SuperJSON,
Expand Down

0 comments on commit 5f2532e

Please sign in to comment.