Brokenwind
Brokenwind8h ago

Next JS error handling.

I'm having this weird error in Next dev whenever I throw an error in a router.
login: publicProcedure.input(loginSchema).mutation(async ({ ctx, input }) => {
const { error } = await ctx.supabase.auth.signInWithPassword({
email: input.email,
password: input.password,
});

if (error) {
throw new TRPCError({ code: "UNAUTHORIZED", message: error.message });
}
}),
login: publicProcedure.input(loginSchema).mutation(async ({ ctx, input }) => {
const { error } = await ctx.supabase.auth.signInWithPassword({
email: input.email,
password: input.password,
});

if (error) {
throw new TRPCError({ code: "UNAUTHORIZED", message: error.message });
}
}),
Am I handling it correctly in the first place? onError works fine but this error in the dev tool is worrying.
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?