public function TestTaskWorker::fail in Search API 8
Handles a task event with an exception.
Parameters
\Drupal\search_api\Task\TaskEvent $event: The task event.
File
- tests/
search_api_test_tasks/ src/ TestTaskWorker.php, line 67
Class
- TestTaskWorker
- Provides a task worker for testing purposes.
Namespace
Drupal\search_api_test_tasksCode
public function fail(TaskEvent $event) {
$this
->logEvent($event);
$event
->stopPropagation();
$event
->setException(new SearchApiException('fail'));
}