protected function createError()
    {
        $error = $this->getForm()->getValidator()->getMessages($this->getElement()->getName());
        if ($error) {
            $this->error = $this->builder->make('error', [], $error);
        }
    }