(err) => {
if (err === 'SQLITE_CONSTRAINT') return next('This email already exists')
//if(err) return next(err)
res.format({
json: () => {
res.send('ok')
}
})
Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: users.email
--> in Statement#run('emzi@hh.ghhn', 'yutyyt', 'ytjyjjyt'