Skip to content

Commit

Permalink
Fix #290 : Add more logs to sqlUnique to help find issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Feb 10, 2018
1 parent 5ec15cf commit a9f1a98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/core/utils/utils.sqlUnique.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = function(query, params){
return gladys.utils.sql(query, params)
.then(function(result){
if(result.length === 0){
sails.log.warn(`gladys.utils.sqlUnique was not able to find element`);
sails.log.warn(`Query = "${query}"`);
sails.log.warn(`Params = "${JSON.stringify(params)}"`);
return Promise.reject(new Error('NotFound'));
} else {
return Promise.resolve(result[0]);
Expand Down

0 comments on commit a9f1a98

Please sign in to comment.