[TASK] Increase verbosity of exception 45/34245/2
authorBjörn Fromme <mail@bjo3rn.com>
Sun, 16 Nov 2014 11:17:31 +0000 (12:17 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 16 Nov 2014 15:57:15 +0000 (16:57 +0100)
Appends package path of invalid composer packages to
the exception message to help identifying the cause.

Resolves: #59998
Releases: master, 6.2
Change-Id: Ie09212c17e15e4193eef422758f001cb289c73ef
Reviewed-on: http://review.typo3.org/34245
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Package/PackageFactory.php

index 8f4e5ac..2f85c69 100644 (file)
@@ -70,6 +70,7 @@ class PackageFactory extends \TYPO3\Flow\Package\PackageFactory {
 
                return $package;
        }
+
        /**
         * Resolves package key from Composer manifest
         *
@@ -81,12 +82,14 @@ class PackageFactory extends \TYPO3\Flow\Package\PackageFactory {
         * Else the composer name will be used with the slash replaced by a dot
         *
         * @param object $manifest
+        * @param string $packagePath
         * @param string $packagesBasePath
+        * @throws \TYPO3\Flow\Package\Exception\InvalidPackageManifestException
         * @return string
         */
        public static function getPackageKeyFromManifest($manifest, $packagePath, $packagesBasePath) {
                if (!is_object($manifest)) {
-                       throw new  \TYPO3\Flow\Package\Exception\InvalidPackageManifestException('Invalid composer manifest.', 1348146451);
+                       throw new  \TYPO3\Flow\Package\Exception\InvalidPackageManifestException('Invalid composer manifest in package path: ' . $packagePath, 1348146451);
                }
                if (isset($manifest->type) && substr($manifest->type, 0, 10) === 'typo3-cms-') {
                        $relativePackagePath = substr($packagePath, strlen($packagesBasePath));