fix: Improve flyout behavior by gonfunko · Pull Request #9576 · RaspberryPiFoundation/blockly
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the block is not successfully created then now the flyout is closed, where previously the event utils would be enabled but then the method would crash (without closing flyout)
I think if a block isn't ultimately created for whatever reason (not sure how likely this method is to throw an error in reality) it would be better for the flyout not to close.
i don't think you need to use a try anymore since we don't have to clean up the event utils. if placeNewBlock errors then just let it error. so you can hideChaff before you return the new block without relying on the finally block.