Skip to content

Commit

Permalink
refactor: safeCallback provides a warning, rather than an error
Browse files Browse the repository at this point in the history
- The query does in fact proceed, but does not send a result
  • Loading branch information
thelindat committed Sep 18, 2021
1 parent be221b7 commit 5e65476
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ setImmediate(async () => {

const safeCallback = (callback, result, error) => {
if (typeof callback === 'function') return callback(result || false);
else return console.log(`^1[ERROR] ${error[0]} was unable to execute a query, callback function was undefined!\n ^1 ${error[1]}^0`);
else return console.log(`^3[WARNING] ${error[0]} executed a query, but no callback function was defined!\n ^3 ${error[1]}^0`);
};

global.exports('execute', (query, parameters, cb, resource = GetInvokingResource()) => {
Expand Down

0 comments on commit 5e65476

Please sign in to comment.