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:
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