node.js - How to get validation errors from specific model when working with transactions? -


right not i'm using code this:

return sequelize     .transaction((t) => {             return usermodel                 .update(req.body.user, {where: {userid: usermodel.id}, transaction: t})                 .then((u) => passport.upsert(_.extend(req.body.passport, {userid: u.id}), {transaction: t}))         })         .then(() => res.flash('success', 'save!'))         .catch(sequelize.validationerror, (err) => {              res.flash('danger', 'error!');              console.log('errors:', err);         }); 

when error @ 'catch', instance of validationerror don't have reference model. result don't know has errors passport or user.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -