public function handleExceptions(ConstraintViolationListInterface $violations) { if ($violations->count() > 0) { $violation = $violations->get(0); $this->throwValidationException($violation); } }