Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
catch (MigrateException $e) {
$this->map->saveIDMapping($this->sourceValues, array(),
$e->getStatus(), $this->rollbackAction, $data_row->migrate_map_hash);
$this->saveMessage($e->getMessage(), $e->getLevel());
self::displayMessage($e->getMessage());
}
catch (Exception $e) {
$this->map->saveIDMapping($this->sourceValues, array(),
MigrateMap::STATUS_FAILED, $this->rollbackAction,
$data_row->migrate_map_hash);
$this->handleException($e);
}
I don't know whether I should throw a MigrateException or an Exception, or whether it depends on the kind of problem. These catch blocks need some comments to explain what they are doing and what sort of problem they expect to be handling.
Comments
Comment #1
pifagor