Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MigrateExecutable.php

function MigrateExecutable::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.

1 call to MigrateExecutable::handleException()
MigrateExecutable::import in core/modules/migrate/src/MigrateExecutable.php
Performs an import operation - migrate items from source to destination.

File

core/modules/migrate/src/MigrateExecutable.php, line 509

Class

MigrateExecutable
Defines a migrate executable class.

Namespace

Drupal\migrate

Code

protected function handleException(\Exception $exception, $save = TRUE) {
    $result = Error::decodeException($exception);
    $message = $result['@message'] . ' (' . $result['%file'] . ':' . $result['%line'] . ')';
    if ($save) {
        $this->saveMessage($message);
    }
    $this->message
        ->display($message, 'error');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal