mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Ensure error messages are toStringed
This commit is contained in:
@@ -35,7 +35,7 @@ function createLibrary(type) {
|
||||
}
|
||||
}).otherwise(function(err) {
|
||||
if (err) {
|
||||
log.warn(log._("api.library.error-load-entry",{path:path,message:err}));
|
||||
log.warn(log._("api.library.error-load-entry",{path:path,message:err.toString()}));
|
||||
if (err.code === 'forbidden') {
|
||||
log.audit({event: "library.get",type:type,error:"forbidden"},req);
|
||||
res.send(403);
|
||||
@@ -57,7 +57,7 @@ function createLibrary(type) {
|
||||
log.audit({event: "library.set",type:type},req);
|
||||
res.send(204);
|
||||
}).otherwise(function(err) {
|
||||
log.warn(log._("api.library.error-save-entry",{path:path,message:err}));
|
||||
log.warn(log._("api.library.error-save-entry",{path:path,message:err.toString()}));
|
||||
if (err.code === 'forbidden') {
|
||||
log.audit({event: "library.set",type:type,error:"forbidden"},req);
|
||||
res.send(403);
|
||||
@@ -89,7 +89,7 @@ module.exports = {
|
||||
res.send(data);
|
||||
}).otherwise(function(err) {
|
||||
if (err) {
|
||||
log.warn(log._("api.library.error-load-flow",{path:req.params[0],message:err}));
|
||||
log.warn(log._("api.library.error-load-flow",{path:req.params[0],message:err.toString()}));
|
||||
if (err.code === 'forbidden') {
|
||||
log.audit({event: "library.get",type:"flow",path:req.params[0],error:"forbidden"},req);
|
||||
res.send(403);
|
||||
@@ -106,7 +106,7 @@ module.exports = {
|
||||
log.audit({event: "library.set",type:"flow",path:req.params[0]},req);
|
||||
res.send(204);
|
||||
}).otherwise(function(err) {
|
||||
log.warn(log._("api.library.error-save-flow",{path:req.params[0],message:err}));
|
||||
log.warn(log._("api.library.error-save-flow",{path:req.params[0],message:err.toString()}));
|
||||
if (err.code === 'forbidden') {
|
||||
log.audit({event: "library.set",type:"flow",path:req.params[0],error:"forbidden"},req);
|
||||
res.send(403);
|
||||
|
@@ -58,7 +58,7 @@ var flowNodes = module.exports = {
|
||||
flowNodes.startFlows();
|
||||
});
|
||||
}).otherwise(function(err) {
|
||||
log.warn(log._("nodes.flows.error",{err:err}));
|
||||
log.warn(log._("nodes.flows.error",{message:err.toString()}));
|
||||
console.log(err.stack);
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user