Log errors to generated code too