From ac4acf98ae27f4eae525d5be1c7c4e1cdaf674ea Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 13 Mar 2014 12:14:11 +0100 Subject: [PATCH] Use console.error for logging errors --- NEWS.md | 2 +- app/controllers/app.js | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9f41ba45..49dedab4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ New features: - - Add optional support for rollbar (#137) + * Add optional support for rollbar (#137) Enhancements: diff --git a/app/controllers/app.js b/app/controllers/app.js index 1836e8d8..cb0d1bbb 100755 --- a/app/controllers/app.js +++ b/app/controllers/app.js @@ -296,8 +296,7 @@ function handleQuery(req, res) { }; tableCache.set(sql_md5, tableCacheItem); } else { - console.log("[ERROR] Unexpected result from CDB_QueryTables($quotesql$" + sql + "$quotesql$)"); - console.dir(result); + console.error("Unexpected result from CDB_QueryTables($quotesql$" + sql + "$quotesql$): " + util.inspect(result)); } } @@ -379,7 +378,6 @@ function handleQuery(req, res) { } ); } catch (err) { - console.log('[ERROR]\n' + err); 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]} if (global.settings.environment !== 'test'){ // TODO: email this Exception report - console.log("EXCEPTION REPORT") - console.log(err.message); - console.log(err.stack); + console.error("EXCEPTION REPORT: " + err.stack) } // allow cross site post