Better reporting of project-not-found

This commit is contained in:
Nick O'Leary
2018-01-24 21:54:18 +00:00
parent 20a0e4f3e0
commit 95589307cd
6 changed files with 16 additions and 6 deletions

View File

@@ -78,8 +78,12 @@ function loadFlows() {
});
}).catch(function(err) {
activeConfig = null;
events.emit("runtime-event",{id:"runtime-state",payload:{type:"warning",error:err.code,text:"notification.warnings."+err.code},retain:true});
log.warn(log._("nodes.flows.error",{message:err.toString()}));
events.emit("runtime-event",{id:"runtime-state",payload:{type:"warning",error:err.code,project:err.project,text:"notification.warnings."+err.code},retain:true});
if (err.code === "project_not_found") {
log.warn(log._("storage.localfilesystem.projects.project-not-found",{project:err.project}));
} else {
log.warn(log._("nodes.flows.error",{message:err.toString()}));
}
throw err;
});
}