Merge pull request #1270 from strongloop/add-error-callback

FindOrCreate missing error callback
This commit is contained in:
Diana Lau 2017-03-20 15:42:20 +00:00 committed by GitHub
commit cc3fb8e3f1
1 changed files with 1 additions and 0 deletions

View File

@ -1067,6 +1067,7 @@ DataAccessObject.findOrCreate = function findOrCreate(query, data, options, cb)
function _findOrCreate(query, data, currentInstance) {
var modelName = self.modelName;
function findOrCreateCallback(err, data, created) {
if (err) return cb(err);
var context = {
Model: Model,
data: data,