diff -u b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php --- b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php +++ b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php @@ -178,7 +178,7 @@ if (!$key_exists) { if (array_key_exists('default_value', $this->configuration)) { if (!empty($this->configuration['bypass'])) { - throw new \InvalidArgumentException('Setting both default_value and bypass is invalid.'); + throw new MigrateException('Setting both default_value and bypass is invalid.'); } return $this->configuration['default_value']; } diff -u b/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php b/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php --- b/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php +++ b/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php @@ -89,7 +89,7 @@ $configuration['bypass'] = TRUE; $this->expectDeprecation('Setting both default_value and bypass is deprecated in drupal:9.4.0 and will throw an InvalidArgumentException in drupal:10.0.0. See https://www.drupal.org/node/3248473'); $this->plugin = new StaticMap($configuration, 'map', []); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(MigrateException::class); $this->expectExceptionMessage('Setting both default_value and bypass is invalid.'); $this->plugin->transform(['bar'], $this->migrateExecutable, $this->row, 'destination_property'); }