-
-
Save jlukanta/6863823 to your computer and use it in GitHub Desktop.
winston logger.error(error) workaround, i.e. Issue #280
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/winston/lib/winston/common.js b/node_modules/winston/lib/winston/common.js | |
index c754942..8f69901 100644 | |
--- a/node_modules/winston/lib/winston/common.js | |
+++ b/node_modules/winston/lib/winston/common.js | |
@@ -73,6 +73,9 @@ exports.clone = function (obj) { | |
else if (obj instanceof Date) { | |
return obj; | |
} | |
+ else if (obj instanceof Error) { | |
+ return obj; | |
+ } | |
var copy = {}; | |
for (var i in obj) { | |
diff --git a/node_modules/winston/node_modules/cycle/cycle.js b/node_modules/winston/node_modules/cycle/cycle.js | |
index 4382285..3df40be 100644 | |
--- a/node_modules/winston/node_modules/cycle/cycle.js | |
+++ b/node_modules/winston/node_modules/cycle/cycle.js | |
@@ -49,6 +49,7 @@ cycle.decycle = function decycle(object) { | |
value instanceof Date || | |
value instanceof Number || | |
value instanceof RegExp || | |
+ value instanceof Error || | |
value instanceof String) { | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment