diff --git a/core/modules/migrate/src/Plugin/migrate/process/Callback.php b/core/modules/migrate/src/Plugin/migrate/process/Callback.php index a7f09312ec..c08b297fb9 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Callback.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Callback.php @@ -2,6 +2,7 @@ namespace Drupal\migrate\Plugin\migrate\process; +use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\ProcessPluginBase; use Drupal\migrate\Row; @@ -44,7 +45,7 @@ * * @code * source: - * plugin: ... + * plugin: foo * constants: * slash: / * process: @@ -86,7 +87,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { if (!empty($this->configuration['unpack_source'])) { if (!is_array($value)) { - throw new \InvalidArgumentException('When "unpack_source" is set, the source must be an array.'); + throw new MigrateException(sprintf("When 'unpack_source' is set, the source must be an array., instead it was of type '%s'", gettype($value))); } return call_user_func($this->configuration['callable'], ...$value); }