protected function validate(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus)
    {
        $exception = new \Magento\Framework\Exception\InputException();

        $validator = new \Zend_Validate();
        if (!$validator->is(trim($thesaurus->getName()), 'NotEmpty')) {
            $exception->addError(__(InputException::REQUIRED_FIELD, ['fieldName' => 'name']));
        }

        if ($exception->wasErrorAdded()) {
            throw $exception;
        }
    }