Commit 58a8fd85 authored by Grand Francois's avatar Grand Francois
Browse files

#46 ajout de messages d'erreur à ParallelStructure.getStructureVarCalc()

Showing with 4 additions and 0 deletions
+4 -0
...@@ -176,8 +176,12 @@ export class ParallelStructure extends Nub { ...@@ -176,8 +176,12 @@ export class ParallelStructure extends Nub {
private getStructureVarCalc(sVarCalc: string): IStructureVarCalc { private getStructureVarCalc(sVarCalc: string): IStructureVarCalc {
let sIndex: string; let sIndex: string;
let sPrm: string; let sPrm: string;
if (sVarCalc.indexOf(".") == -1)
throw new Error(`getStructureVarCalc() : erreur d'analyse de ${sVarCalc}, (pas de la forme n.X)`);
[sIndex, sPrm] = sVarCalc.split("."); [sIndex, sPrm] = sVarCalc.split(".");
const i = parseInt(sIndex, 10); const i = parseInt(sIndex, 10);
if (i === NaN)
throw new Error(`getStructureVarCalc() : erreur d'analyse de ${sVarCalc} (${sIndex} n'est pas un nombre)`);
return { index: i, prm: sPrm }; return { index: i, prm: sPrm };
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment