Issue #3308162 by immaculatexavier, chaubeyji, joachim, catch: KernelTestBase::installConfig() should catch exceptions and rethrow them to say which module caused the problem

merge-requests/2817/head
Alex Pott 2022-09-27 20:16:25 +01:00
parent 2aa0817d69
commit cc7f697733
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
1 changed files with 6 additions and 1 deletions

View File

@ -700,7 +700,12 @@ abstract class KernelTestBase extends TestCase implements ServiceProviderInterfa
if (!$this->container->get('module_handler')->moduleExists($module)) {
throw new \LogicException("$module module is not enabled.");
}
$this->container->get('config.installer')->installDefaultConfig('module', $module);
try {
$this->container->get('config.installer')->installDefaultConfig('module', $module);
}
catch (\Exception $e) {
throw new \Exception(sprintf('Exception when installing config for module %s, message was: %s', $module, $e->getMessage()), 0, $e);
}
}
}