Skip to content

Commit

Permalink
fix(query): return a Promise when failing
Browse files Browse the repository at this point in the history
  • Loading branch information
mastilver committed Dec 24, 2016
1 parent 818b45d commit 44bd4ee
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ module.exports = function (options) {
},

query(queryOptions) {
queryOptions = queryOptions || {};
return Promise.resolve()
.then(() => {
queryOptions = queryOptions || {};

const sql = buildQuery(collectionName, queryOptions);
const sql = buildQuery(collectionName, queryOptions);

return db.query(sql.query, {
params: sql.params
return db.query(sql.query, {
params: sql.params
});
});
}
};
Expand Down

0 comments on commit 44bd4ee

Please sign in to comment.