NREL / OpenStudio-workflow-gem

http://openstudio.net
Other
14 stars 4 forks source link

<error> in measure.xml breaks post-processing step #122

Open macumber opened 3 years ago

macumber commented 3 years ago

If a measure has a Ruby error in the measure.xml, this code adds a second root element: https://github.com/NREL/OpenStudio/blob/develop/src/utilities/bcl/BCLXML.cpp#L660

When running post-processing, REXML is used to load the measure.xml: https://github.com/NREL/OpenStudio-workflow-gem/blob/develop/lib/openstudio/workflow/util/post_process.rb#L196

This results in the error: #<RuntimeError: attempted adding second root element to document>\n:/ruby/2.5.0/rexml/document.rb:96

macumber commented 3 years ago

Could probably just wrap the xml reading code in a begin/rescue and fall back to measure dir