Skip to content

Commit

Permalink
MAGETWO-67405: Improved text of exception message in case of error in…
Browse files Browse the repository at this point in the history
… module's composer.json #9165
  • Loading branch information
Oleksii Korshenko authored Apr 12, 2017
2 parents 5acb93b + 3cb6105 commit 2e5e5e5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/internal/Magento/Framework/Module/PackageInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,18 @@ private function load()
foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) {
$key = $moduleDir . '/composer.json';
if (isset($jsonData[$key]) && $jsonData[$key]) {
$packageData = \Zend_Json::decode($jsonData[$key]);
try {
$packageData = \Zend_Json::decode($jsonData[$key]);
} catch (\Zend_Json_Exception $e) {
throw new \Zend_Json_Exception(
sprintf(
"%s composer.json error: %s",
$moduleName,
$e->getMessage()
)
);
}

if (isset($packageData['name'])) {
$this->packageModuleMap[$packageData['name']] = $moduleName;
}
Expand Down

0 comments on commit 2e5e5e5

Please sign in to comment.