You are here

protected function FeedsExecutable::handleException in Feeds 8.3

Handles an exception during importing.

Parameters

\Drupal\feeds\FeedInterface $feed: The feed.

string $stage: The stage which the import is at.

array $params: Parameters relevant to current stage.

\Exception $exception: The exception that was thrown.

Throws

\Exception Thrown if the exception should not be ignored.

1 call to FeedsExecutable::handleException()
FeedsExecutable::processItem in src/FeedsExecutable.php
Processes a stage of an import.
1 method overrides FeedsExecutable::handleException()
FeedsQueueExecutable::handleException in src/FeedsQueueExecutable.php
Handles an exception during importing.

File

src/FeedsExecutable.php, line 180

Class

FeedsExecutable
Defines a feeds executable class.

Namespace

Drupal\feeds

Code

protected function handleException(FeedInterface $feed, $stage, array $params, Exception $exception) {
  $feed
    ->finishImport();
  if ($exception instanceof EmptyFeedException) {
    return;
  }
  if ($exception instanceof RuntimeException) {
    $this->messenger
      ->addError($exception
      ->getMessage());
    return;
  }
  throw $exception;
}