Pete
CCConvex Community
•Created by Pete on 4/1/2024 in #support-community
Convex Error
thanks alot
3 replies
CCConvex Community
•Created by Varun Singh on 12/29/2023 in #support-community
Does ConvexError replace Error?
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;
},
});
6 replies
CCConvex Community
•Created by Varun Singh on 12/29/2023 in #support-community
Does ConvexError replace Error?

6 replies