put preprocess loop errors inside an error span