Open kapouer opened 9 years ago
Hi, i am finding myself doing
instance.save(function(err) { if (err && err.code == 23505) return res.sendStatus(409); ... });
and it's bad because it depends on the error code returned by postgres for a duplicate key constraint violation. It would be nicer to have a specific orm error in that situation.
Hi, i am finding myself doing
and it's bad because it depends on the error code returned by postgres for a duplicate key constraint violation. It would be nicer to have a specific orm error in that situation.