diff --git a/src/app/formulaire/ngparam.ts b/src/app/formulaire/ngparam.ts index 10ed519628c99864921882ea8ba5d925b68f5fc1..9d9ce7c9c873d8e1238c6d41da65a0494e859d09 100644 --- a/src/app/formulaire/ngparam.ts +++ b/src/app/formulaire/ngparam.ts @@ -98,6 +98,7 @@ export class NgParameter extends InputField implements Observer { // calculated param ? if (targetParam.valueMode === ParamValueMode.CALCUL) { // was the result already computed ? + // @WAARNING .result might be set but the computation might have failed (dichotomy for ex.) if (p.referencedValue.nub.result) { if (p.referencedValue.hasMultipleValues()) { // like LIST mode @@ -110,7 +111,8 @@ export class NgParameter extends InputField implements Observer { if (vCalc) { valuePreview = String(vCalc.toFixed(nDigits)); } else { - throw new Error("NgParameter.preview() : No vCalc for computed target Nub !"); + // computation has been run but has failed + valuePreview = i18n.localizeText("INFO_PARAMFIELD_CALCULATION_FAILED"); } } } else { diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index beb07be9fd2ebccfc24adc2fcda97df98a05f50b..d4e1a6420e5f11e1e8e4fbb05ad50f020cf47dac 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -159,6 +159,7 @@ "INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM": "Histogram", "INFO_PARAMFIELD_GRAPH_SELECT_X_AXIS": "Variable for X axis", "INFO_PARAMFIELD_GRAPH_SELECT_Y_AXIS": "Variable for Y axis", + "INFO_PARAMFIELD_CALCULATION_FAILED": "Calculation failed", "INFO_PARAMFIELD_IN_CALCULATION": "In calculation", "INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE": "initial value", "INFO_PARAMFIELD_PARAMCALCULER": "Calculate", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 2dddd1782c9445c20efb72e7314f663a016d02a4..8627ade07888a7da9d144dd827c5e0b05bd168f0 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -159,6 +159,7 @@ "INFO_PARAMFIELD_GRAPH_TYPE_HISTOGRAM": "Histogramme", "INFO_PARAMFIELD_GRAPH_SELECT_X_AXIS": "Variable en abscisse", "INFO_PARAMFIELD_GRAPH_SELECT_Y_AXIS": "Variable en ordonnée", + "INFO_PARAMFIELD_CALCULATION_FAILED": "Échec du calcul", "INFO_PARAMFIELD_IN_CALCULATION": "En calcul", "INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE": "valeur initiale", "INFO_PARAMFIELD_PARAMCALCULER": "calculer",