Removing report_error() duplication