Improve logging for server SQL requests

This commit is contained in:
Logan Cusano
2023-06-18 22:22:20 -04:00
parent 878e64fa42
commit 255b1282ec

View File

@@ -352,12 +352,12 @@ exports.getAllConnections = async (callback = undefined) => {
// Function to run and handle SQL errors
function runSQL(sqlQuery, callback = undefined, error = (err) => {
console.log(err);
log.ERROR(err);
throw err;
}) {
connection.query(sqlQuery, (err, rows) => {
if (err) return error(err);
//console.log('The rows are:', rows);
log.VERBOSE('Response for query: ', sqlQuery, rows);
return (callback) ? callback(rows) : rows
})
}