Merge pull request #641 from rus0000/rus0000-patch-1-fix-promise

Fix promise chaining in case of error
This commit is contained in:
Raymond Feng 2015-06-23 14:33:07 -07:00
commit 103b21a717
1 changed files with 2 additions and 1 deletions

View File

@ -2246,9 +2246,10 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, op
var err = new Error('id property (' + idName + ') ' +
'cannot be updated from ' + inst[idName] + ' to ' + data[idName]);
err.statusCode = 400;
return process.nextTick(function() {
process.nextTick(function() {
cb(err);
});
return cb.promise;
}
}