What is the best way to handle Query Errors?

Hello, everyone! I'm testing Drizzle right now and i'm a little confused about what is the best way to handle erros in Drizzle. I have a POST method that creates a user and the e-mail is unique. When the e-mail is already in use and Drizzle throws a error, the error type is DrizzleQueryError, imported from "drizzle-kit/erros", but it seems broken, i dont have the right type for the error code. Thanks in advance!
No description
No description
No description
1 Reply
Helm
Helm4mo ago
@Rossi Hello U can import DrizzleQueryError from import { DrizzleQueryError } from 'drizzle-orm/errors';

Did you find this page helpful?