src/Widget/AbstractWidget.php
protected function createError()
    {
        $error = $this->getForm()->getValidator()->getMessages($this->getElement()->getName());
        if ($error) {
            $this->error = $this->builder->make('error', [], $error);
        }
    }
protected function createError()
    {
        $error = $this->getForm()->getValidator()->getMessages($this->getElement()->getName());
        if ($error) {
            $this->error = $this->builder->make('error', [], $error);
        }
    }
Creates the error tag