1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

add utils.inspect result and be more explicit about the error.

This commit is contained in:
Simon Hailes 2019-11-02 10:39:22 +00:00
parent bc283aa025
commit eb09ec6834

View File

@ -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;