mirror of
https://github.com/node-red/node-red
synced 2024-11-22 16:33:24 +00:00
add utils.inspect result and be more explicit about the error.
This commit is contained in:
parent
bc283aa025
commit
eb09ec6834
@ -784,9 +784,12 @@ function encodeObject(msg,opts) {
|
||||
errorMsg.name = e.name;
|
||||
}
|
||||
if (e.hasOwnProperty('message')) {
|
||||
errorMsg.message = e.message;
|
||||
errorMsg.message = 'encodeObject Error: ['+e.message + '] Value: '+util.inspect(msg.msg);
|
||||
} else {
|
||||
errorMsg.message = e.toString();
|
||||
errorMsg.message = 'encodeObject Error: ['+e.toString() + '] Value: '+util.inspect(msg.msg);
|
||||
}
|
||||
if (errorMsg.message.length > debuglength) {
|
||||
errorMsg.message = errorMsg.message.substring(0,debuglength);
|
||||
}
|
||||
msg.msg = JSON.stringify(errorMsg);
|
||||
return msg;
|
||||
|
Loading…
Reference in New Issue
Block a user