move text of error messages from ERROR to functions which gen them