BrokenwindB
tRPC9mo ago
5 replies
Brokenwind

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 });
    }
  }),


Am I handling it correctly in the first place? onError works fine but this error in the dev tool is worrying.
image.png
Was this page helpful?