It turns out the error command does nothing in the generated code.

So we need a way to ensure that the errors are propagated when using the generated C++.
I am thinking an old-school error code system where a global error state can be set to inform of the error and then a function can be used to check the state before proceeding.