Fix #7806 - ExpandObjects error handling#11646
Conversation
errorCondition/hadSevereError booleans replaced with numErrors/numWarnings counters, and the exit message now mirrors EnergyPlus's own style — "ExpandObjects Completed Successfully-- N Warning; 0 Severe Errors. Time:" or "ExpandObjects Terminated--Error(s) Detected. N Warning; N Severe Errors. Time:", with exit code still driven by numErrors > 0
…an report them even if schema validation fails
|
Live testing, using https://github.com/NatLabRockies/EnergyPlusDevSupport/blob/master/DefectFiles/7000s/7806/VAV_Sys_26_2_0.idf (I translated it from the original 9.2 IDF) Before:ExpandObjects returns 0, so E+ still tries to simulate it, and only the schema validation errors happen. $ $ep_build_rel-develop/Products/energyplus -x -D -d out-ori VAV_Sys_26_2_0.idf
ExpandObjects Started.
Begin reading Energy+.idd file.
Done reading Energy+.idd file.
ExpandObjects Finished with Error(s). Time: 0.040
EnergyPlus Starting
EnergyPlus, Version 26.2.0-7cfca988f9, YMD=2026.06.18 17:38
**FATAL:Errors occurred on processing input file. Preceding condition(s) cause termination.
EnergyPlus Run Time=00hr 00min 0.08sec
Program terminated: EnergyPlus Terminated--Error(s) Detected.
$ cat out-ori/eplusout.err
Program Version,EnergyPlus, Version 26.2.0-7cfca988f9, YMD=2026.06.18 17:38,
** Severe ** Line: 4459 Index: 10 - Field cannot be Autosize or Autocalculate
** Severe ** Line: 4461 Index: 10 - Field cannot be Autosize or Autocalculate
** Severe ** <root>[Connector:Splitter][Chiled Water Loop CndW Supply Splitter][branches][20] - Missing required property 'outlet_branch_name'.
** Fatal ** Errors occurred on processing input file. Preceding condition(s) cause termination.
...Summary of Errors that led to program termination:
..... Reference severe error count=3
..... Last severe error=<root>[Connector:Splitter][Chiled Water Loop CndW Supply Splitter][branches][20] - Missing required property 'outlet_branch_name'.
************* Warning: Node connection errors not checked - most system input has not been read (see previous warning).
************* Fatal error -- final processing. Program exited before simulations began. See previous error messages.
************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
************* EnergyPlus Terminated--Fatal Error Detected. 0 Warning; 3 Severe Errors; Elapsed Time=00hr 00min 0.08seNow:ExpandObjects returned 1, so E+ stops there. $ $ep_build_rel/Products/energyplus -x -D -d out-new VAV_Sys_26_2_0.idf
ExpandObjects Started.
Begin reading Energy+.idd file.
Done reading Energy+.idd file.
ExpandObjects Terminated--Error(s) Detected. 1 Warning; 1 Severe Errors; Time: 0.048
ERROR: ExpandObjects failed to expand the HVACTemplate:* or GroundHeatTransfer:* objects in this input file.
See /home/julien/Software/Others/EnergyPlusDevSupport/DefectFiles/7000s/7806/out-new/eplusout.experr for details.If I try to run the expidf anyways, I get the schema validation errors AND the Output:ProcessorMessage into the eplusout.err $ cd out-new
$ $ep_build_rel/Products/energyplus -D -d out-force in.idf
EnergyPlus Starting
EnergyPlus, Version 26.2.0-24256e83e2, YMD=2026.06.18 17:42
**FATAL:Errors occurred on processing input file. Preceding condition(s) cause termination.
EnergyPlus Run Time=00hr 00min 0.07sec
Program terminated: EnergyPlus Terminated--Error(s) Detected.
$ cat out-force/eplusout.err
Program Version,EnergyPlus, Version 26.2.0-24256e83e2, YMD=2026.06.18 17:42,
** Severe ** Line: 4459 Index: 10 - Field cannot be Autosize or Autocalculate
** Severe ** Line: 4461 Index: 10 - Field cannot be Autosize or Autocalculate
** Severe ** <root>[Connector:Splitter][Chiled Water Loop CndW Supply Splitter][branches][20] - Missing required property 'outlet_branch_name'.
** Warning ** Output:PreprocessorMessage="ExpandObjects" has the following Warning conditions:
** ~~~ ** Warning: In HVACTemplate:System:VAV "VAV" there is no Heating Coil and no
** ~~~ ** Preheat Coil. The Preheat Coil Design Setpoint will be used for the
** ~~~ ** Sizing:System Central Heating Design Supply Air Temperature. This will be
** ~~~ ** the inlet air temperature for sizing reheat coils.
** Severe ** Output:PreprocessorMessage="ExpandObjects" has the following Fatal conditions:
** ~~~ ** Severe: In HVACTemplate:Plant:ChilledWaterLoop "Chiled Water Loop" there
** ~~~ ** is one or more water cooled chiller(s) but there are no towers serving this
** ~~~ ** loop.
** Fatal ** Errors occurred on processing input file. Preceding condition(s) cause termination.
...Summary of Errors that led to program termination:
..... Reference severe error count=4
..... Last severe error=Output:PreprocessorMessage="ExpandObjects" has the following Fatal conditions:
************* Warning: Node connection errors not checked - most system input has not been read (see previous warning).
************* Fatal error -- final processing. Program exited before simulations began. See previous error messages.
************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
************* EnergyPlus Terminated--Fatal Error Detected. 1 Warning; 4 Severe Errors; Elapsed Time=00hr 00min 0.07sec |
|
|
||
| if (!is_valid || hasErrors || unsupportedFound) { | ||
| ShowFatalError(state, "Errors occurred on processing input file. Preceding condition(s) cause termination."); | ||
| } |
There was a problem hiding this comment.
Don't you still want to fatal out on these before proceeding? If the IDF/epJSON are bad, is there any need to continue processing?
There was a problem hiding this comment.
bool const PreP_Fatal = preProcessorCheck(state);
if (!is_valid || hasErrors || unsupportedFound || PreP_Fatal) {
ShowFatalError(state, "Errors occurred on processing input file. Preceding condition(s) cause termination.");
}
is a few lines after, so it will throw, but just will also have issued the Output:ProcessorMessages (if any) beforehand anwyays.
|
|
||
| if (!is_valid || hasErrors || unsupportedFound) { | ||
| ShowFatalError(state, "Errors occurred on processing input file. Preceding condition(s) cause termination."); | ||
| } |
There was a problem hiding this comment.
bool const PreP_Fatal = preProcessorCheck(state);
if (!is_valid || hasErrors || unsupportedFound || PreP_Fatal) {
ShowFatalError(state, "Errors occurred on processing input file. Preceding condition(s) cause termination.");
}
is a few lines after, so it will throw, but just will also have issued the Output:ProcessorMessages (if any) beforehand anwyays.
| // Check for Output:PreprocessorMessage objects here, before the fatal abort below, so that a | ||
| // preprocessor's actual root-cause message (e.g. from ExpandObjects) is shown to the user even | ||
| // when the preprocessor's malformed output also triggers epJSON schema validation errors. | ||
| bool const PreP_Fatal = preProcessorCheck(state); | ||
|
|
||
| if (!is_valid || hasErrors || unsupportedFound || PreP_Fatal) { | ||
| ShowFatalError(state, "Errors occurred on processing input file. Preceding condition(s) cause termination."); | ||
| } |
There was a problem hiding this comment.
New check is here. Will have issued the Output:PreProcessorMessage warnings anyways.
Pull request overview
Description of the purpose of this PR
-xflag, terminate if it returns non zeroFatalOutput:PreprocessorMessage, we issue those instead of terminating after the Schema Validation, by moving the preProcessorCheck into the InputProcessor instead of SimulationManager::PostIPProcessingPull Request Author
Reviewer