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

 - Merge Pull Request #9165 from vovayatsyuk/magento2:patch-2
  • Loading branch information
Oleksii Korshenko committed Apr 12, 2017
2 parents e9d894f + c22243e commit 3cb6105
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 3cb6105

Please sign in to comment.