Skip to content

Commit

Permalink
Return api failure response (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajanutanix authored and Harishgolla committed Feb 8, 2019
1 parent af7f902 commit 8644dc9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = (function () {
spawnConnection(connection.identity)
.then(function() {cb()})
.fail(cb)
.done();
}
},

Expand All @@ -63,7 +64,9 @@ module.exports = (function () {
cb(arguments[0], arguments[1])
}
).where(options.where)
})
})
.fail(cb)
.done();
},

find: function(connectionName, collectionName, options, cb) {
Expand Down Expand Up @@ -99,6 +102,8 @@ module.exports = (function () {
// the connection config within the app.
.execute({autoFetch: true, maxFetch: 10000})
})
.fail(cb)
.done();
},

create: function(connectionName, collectionName, data, cb) {
Expand All @@ -122,6 +127,8 @@ module.exports = (function () {
return cb(null, _.omit(result, 'success', 'errors'))
})
})
.fail(cb)
.done();
},

update: function(connectionName, collectionName, options, values, cb) {
Expand All @@ -137,6 +144,8 @@ module.exports = (function () {
cb(null, result)
})
})
.fail(cb)
.done();
},

native: function(connectionName, collectionName, cb) {
Expand Down Expand Up @@ -193,6 +202,8 @@ module.exports = (function () {
return cb(err, _.omit(ret, 'success', 'errors'));
});
})
.fail(cb)
.done();
},
///////////////////////////////////////////////////////////////////////////
// Optional Overrides :: Methods defined here can override built in dynamic
Expand Down

0 comments on commit 8644dc9

Please sign in to comment.