Add generateErrExpr function
Fix upload of generateErrExpr