Enclose error exporting function