PeteP
Convex Community2y ago
2 replies
Pete

Convex Error

can someone tell me why the exception shows in console ? and is there any workaround to fix this ? is there any way i can remove this from the browser console ? or will it automatically remove in the production ?

this is my code just in case


import { v, ConvexError } from "convex/values";
import { mutation } from "../_generated/server";

export const validateUser = mutation({
args: {
email: v.string(),
password: v.string(),
},
handler: async (ctx, args) => {
const user = await ctx.db.query("users").filter((q) => q.eq(q.field('email'), args.email)).filter((q) => q.eq(q.field('password'), args.password)).first();
if (!user) {
throw new ConvexError({
code: 123,
severity: "high",
});
}
return user;
},
});
2024-04-01_14.22.46_localhost_54a37d153b93.png
Was this page helpful?