Refactored ReportError. But it is global now.