:doc: Message d'erreur quand objectif de calcul inconnu

co2
Mael 2018-09-26 13:00:05 +00:00
parent b1d6ea24c1
commit 7a478c1c0a
1 changed files with 8 additions and 1 deletions

View File

@ -333,7 +333,14 @@ export let analyseMany = (parsedRules, targetNames) => situationGate => {
}
let nonBlockingControls = evaluateControls(false)(parsedRules, situationGate)
let parsedTargets = targetNames.map(t => findRule(parsedRules, t)),
let parsedTargets = targetNames.map(t => {
let parsedTarget = findRule(parsedRules, t)
if (!parsedTarget)
throw new Error(
`L'objectif de calcul "${t}" ne semble pas exister dans la base de règles`
)
return parsedTarget
}),
targets = chain(pt => getTargets(pt, parsedRules), parsedTargets).map(t =>
evaluateNode(cache, situationGate, parsedRules, t)
)