8000 small tweak to exception handling · lalitkapoor/log4js-node@612d9ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 612d9ee

Browse files
author
csausdev
committed
small tweak to exception handling
1 parent c870289 commit 612d9ee

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/log4js.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ module.exports = function (fileSystem, standardOutput, configPaths) {
284284
if (exception && exception.message && exception.name) {
285285
this.exception = exception;
286286
} else if (exception) {
287-
this.exception = new Error(exception);
287+
this.exception = new Error(sys.inspect(exception));
288288
}
289289
}
290290

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "log4js",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Port of Log4js to work with node.",
55
"keywords": [
66
"logging",

test/logging.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ vows.describe('log4js').addBatch({
3030
logger.trace("Trace event 2");
3131
logger.warn("Warning event");
3232
logger.error("Aargh!", new Error("Pants are on fire!"));
33-
logger.error("Simulated CouchDB problem", JSON.stringify({ err: 127, cause: "incendiary underwear" }));
33+
logger.error("Simulated CouchDB problem", { err: 127, cause: "incendiary underwear" });
3434
return events;
3535
},
3636

@@ -52,7 +52,7 @@ vows.describe('log4js').addBatch({
5252

5353
'should convert things that claim to be errors into Error objects': function (events) {
5454
assert.instanceOf(events[3].exception, Error);
55-
assert.equal(events[3].exception.message, '{"err":127,"cause":"incendiary underwear"}');
55+
assert.equal(events[3].exception.message, "{ err: 127, cause: 'incendiary underwear' }");
5656
},
5757

5858
},

0 commit comments

Comments
 (0)
0