Collect errors instead of printing them, to ease analysis.