Problem/Motivation
In #2976098: MigrateExecutable should add details for the migration & destination property to exceptions that cause a row failure, the migration ID and destination property was added to migration failure messages.
For a process pipeline with several plugins, that can still leave some detective work finding the source of the problem.
It would be useful to add the process plugin ID, and also the index number, since the same process plugin can occur several times in a single pipeline.
Steps to reproduce
Proposed resolution
Move the catch in import():
catch (MigrateException $e) {
$this->getIdMap()->saveIdMapping($row, [], $e->getStatus());
$msg = sprintf("%s:%s: %s", $this->migration->getPluginId(), $destination_property_name, $e->getMessage());
$this->saveMessage($msg, $e->getLevel());
$save = FALSE;
}
to processPipeline(), which has the plugin name, and add an $index to the foreach loop.
This should then re-throw the exception with the process plugin details prefixed to the message.