format errors for display