Our HTML menu implementation is not consistent. For "firstInSection"/"lastInSection", if the section is not in the specified menu, we show an error and then append the menu item. For "before"/"after", if the command is not in the menu, we show an error and _do not_ add the menu item.

I think it's better to show an error and _not_ add the menu item. Otherwise developers may miss the error, but see the menu item and assume everything is working fine.