Skip to content

Commit ef525e5

Browse files
author
Jānis Elmeris
committed
Display a more meaningful error message in case of misspelt module name.
[LogicException] Component 'VendorA_ModuleB' of type '' is not correctly registered. instead of [Magento\Framework\Exception\FileSystemException] The file "/composer.json" doesn't exist
1 parent b0babda commit ef525e5

File tree

1 file changed

+4
-0
lines changed
  • lib/internal/Magento/Framework/Module

1 file changed

+4
-0
lines changed

lib/internal/Magento/Framework/Module/Dir.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public function getDir($moduleName, $type = '')
4545
{
4646
$path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName);
4747

48+
if (! isset($path)) {
49+
throw new \LogicException("Component '$moduleName' of type '$type' is not correctly registered.");
50+
}
51+
4852
if ($type) {
4953
if (!in_array($type, [
5054
self::MODULE_ETC_DIR,

0 commit comments

Comments
 (0)