Ensure error messages are toStringed

This commit is contained in:
Nick O'Leary
2015-06-16 16:09:53 +01:00
parent 48df31d7b7
commit 9ca102cf81
8 changed files with 23 additions and 23 deletions

View File

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