Error trapping to data validation.