Only log errors when config.debug is true

This commit is contained in:
Tankred Hase 2016-02-04 14:08:56 +07:00
parent 316a37a1cd
commit d67efe22eb

View File

@ -382,7 +382,9 @@ function execute(cmd, errMsg) {
*/ */
function onError(message, error) { function onError(message, error) {
// log the stack trace // log the stack trace
console.error(error.stack); if (config.debug) {
console.error(error.stack);
}
// rethrow new high level error for api users // rethrow new high level error for api users
throw new Error(message); throw new Error(message);
} }