Merge pull request #1270 from strongloop/add-error-callback
FindOrCreate missing error callback
This commit is contained in:
commit
cc3fb8e3f1
|
@ -1067,6 +1067,7 @@ DataAccessObject.findOrCreate = function findOrCreate(query, data, options, cb)
|
||||||
function _findOrCreate(query, data, currentInstance) {
|
function _findOrCreate(query, data, currentInstance) {
|
||||||
var modelName = self.modelName;
|
var modelName = self.modelName;
|
||||||
function findOrCreateCallback(err, data, created) {
|
function findOrCreateCallback(err, data, created) {
|
||||||
|
if (err) return cb(err);
|
||||||
var context = {
|
var context = {
|
||||||
Model: Model,
|
Model: Model,
|
||||||
data: data,
|
data: data,
|
||||||
|
|
Loading…
Reference in New Issue