BHoM / BHoM_UI

GNU Lesser General Public License v3.0
9 stars 5 forks source link

Make components always unsuppress event recordings at end of their run #485

Closed IsakNaslundBh closed 6 months ago

IsakNaslundBh commented 6 months ago

Description:

Slight risk of the introduction of event suppression in https://github.com/BHoM/BHoM_Engine/pull/3286 is that it is global, and if anything happens that means that the call to StopSuppressRecordingEvents is not reached for whatever reason (pre-mature return/exception/something else) that will mean that the warning system is supressed for all other components running in a script.

As a safety mechanism, we could add in a call to StopSuppressRecordingEvents as a final step to be called from the run method in the BHoM_UI to ensure that the warning system is always on for subsequent components.

FraserGreenroyd commented 6 months ago

Welcome back to BHoM land @IsakNaslundBh - glad to see you're picking up on the changes we've made and already finding improvements 😄

FraserGreenroyd commented 6 months ago

I would add the ThrowErrorsAsExceptions method to this as well and ensuring that resets to the default state as well (once https://github.com/BHoM/BHoM_Engine/pull/3302 is merged).