sequelize.js - How to Handle Errors When Using the .create(...) Method in Sequelize -
hi sequelize experts!
i ask, how handle errors when using method .create(...)
. found posts both in documentation , in stackoverflow on how handle errors .build()
, findorcreate()
methods not create()
method.
comments highly appreciated.
note: using sequelize v3.1.0 , tedious v1.11.0.
all async actions in sequelize returns promise
a promise object mehods invoked, based on whether async action succeeded or not
model.create/findorcreate/update/whatever.then(function () { // invoked on success }).catch(function () { // invoked on failure });
Comments
Post a Comment