added error messages to codegen