What's the best way to handle any database errors in this following snippet:
export async function signupService(username: string, email: string, password: string) {
const passwordHash = await bcrypt.hash(password, config.saltRounds)
await db.insert(t.users).values({ username, email, passwordHash })
}
I'm using NodeJS + ExpressJS + DrizzleORM, I would like to know the general best way to handle errors in applications such as this.
Top comments (0)