mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
small update to log - if toString() causes exception, then note and use util.inspect instead - prevents log from causing processes to abort through exception.
Add tests.
This commit is contained in:
@@ -224,5 +224,19 @@ describe("@node-red/util/log", function() {
|
||||
|
||||
|
||||
});
|
||||
it('it can log without exception', function() {
|
||||
var msg = {
|
||||
msg: {
|
||||
mystrangeobj:"hello",
|
||||
},
|
||||
};
|
||||
msg.msg.toString = function(){
|
||||
throw new Error('Exception in toString - should have been caught');
|
||||
}
|
||||
msg.msg.constructor = { name: "strangeobj" };
|
||||
var ret = log.info(msg.msg);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user