You are here

public function TestMigrateExecutable::handleException in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php \Drupal\Tests\migrate\Unit\TestMigrateExecutable::handleException()

Takes an Exception object and both saves and displays it.

Pulls in additional information on the location triggering the exception.

Parameters

\Exception $exception: Object representing the exception.

bool $save: (optional) Whether to save the message in the migration's mapping table. Set to FALSE in contexts where this doesn't make sense.

Overrides MigrateExecutable::handleException

File

core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php, line 65
Contains \Drupal\Tests\migrate\Unit\TestMigrateExecutable.

Class

TestMigrateExecutable
Tests MigrateExecutable.

Namespace

Drupal\Tests\migrate\Unit

Code

public function handleException(\Exception $exception, $save = TRUE) {
  $message = $exception
    ->getMessage();
  if ($save) {
    $this
      ->saveMessage($message);
  }
  $this->message
    ->display($message);
}