controllers/api.js
function sendError(res,err) {
    console.error(err);
    // also log last executed query, for easier debugging
    console.error(lastQry.sql);
    res.statusCode = 500;
    res.send({
        result: 'error',
        err:    err
    });
}
function sendError(res,err) {
    console.error(err);
    // also log last executed query, for easier debugging
    console.error(lastQry.sql);
    res.statusCode = 500;
    res.send({
        result: 'error',
        err:    err
    });
}
function sendError ( res , err ) { console . error ( err ) ; // also log last executed query, for easier debugging console . error ( lastQry . sql ) ; res . statusCode = 500 ; res . send ( { result : 'error' , err : err } ) ; }
Send error messsage to the user
@param res
@param err
Send error messsage to the user