Added utility method to extract the first error from a validation error.