Use console.error for logging errors
This commit is contained in:
parent
65f31fd7c1
commit
ac4acf98ae
2
NEWS.md
2
NEWS.md
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
New features:
|
New features:
|
||||||
|
|
||||||
- Add optional support for rollbar (#137)
|
* Add optional support for rollbar (#137)
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
|
|
||||||
|
@ -296,8 +296,7 @@ function handleQuery(req, res) {
|
|||||||
};
|
};
|
||||||
tableCache.set(sql_md5, tableCacheItem);
|
tableCache.set(sql_md5, tableCacheItem);
|
||||||
} else {
|
} else {
|
||||||
console.log("[ERROR] Unexpected result from CDB_QueryTables($quotesql$" + sql + "$quotesql$)");
|
console.error("Unexpected result from CDB_QueryTables($quotesql$" + sql + "$quotesql$): " + util.inspect(result));
|
||||||
console.dir(result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +378,6 @@ function handleQuery(req, res) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('[ERROR]\n' + err);
|
|
||||||
handleException(err, res);
|
handleException(err, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -422,9 +420,7 @@ function handleException(err, res){
|
|||||||
var msg = (global.settings.environment == 'development') ? {error:[err.message], stack: err.stack} : {error:[err.message]}
|
var msg = (global.settings.environment == 'development') ? {error:[err.message], stack: err.stack} : {error:[err.message]}
|
||||||
if (global.settings.environment !== 'test'){
|
if (global.settings.environment !== 'test'){
|
||||||
// TODO: email this Exception report
|
// TODO: email this Exception report
|
||||||
console.log("EXCEPTION REPORT")
|
console.error("EXCEPTION REPORT: " + err.stack)
|
||||||
console.log(err.message);
|
|
||||||
console.log(err.stack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow cross site post
|
// allow cross site post
|
||||||
|
Loading…
Reference in New Issue
Block a user