@@ -46,6 +46,11 @@ class Queue
4646 */
4747 private $ inProgress = [];
4848
49+ /**
50+ * @var Package[]
51+ */
52+ private $ failed = [];
53+
4954 /**
5055 * @var int
5156 */
@@ -193,8 +198,13 @@ public function process()
193198
194199 $ this ->awaitForAllProcesses ();
195200
196- if (!empty ($ packages )) {
197- throw new TimeoutException ('Not all packages are deployed. ' );
201+ $ failedPackages = array_merge ($ this ->failed , $ packages );
202+ if (!empty ($ failedPackages )) {
203+ throw new \RuntimeException (
204+ 'The following packages have failed to deploy '
205+ .PHP_EOL
206+ .implode (PHP_EOL , array_keys ($ failedPackages ))
207+ );
198208 }
199209
200210 return $ returnStatus ;
@@ -280,9 +290,7 @@ private function awaitForAllProcesses()
280290 $ isDeployed = $ this ->isDeployed ($ package );
281291
282292 if ($ isDeployed === false ) {
283- throw new \RuntimeException (
284- "Deploy of the package " . $ package ->getPath () . " has failed. "
285- );
293+ $ this ->failed [$ package ->getPath ()]= $ this ->packages [$ package ->getPath ()];
286294 } elseif ($ isDeployed ) {
287295 unset($ this ->inProgress [$ name ]);
288296 }
@@ -363,9 +371,7 @@ function () use ($package) {
363371 } else {
364372 $ isDeployed = $ this ->deployPackageService ->deploy ($ package , $ this ->options );
365373 if ($ isDeployed === false ) {
366- throw new \RuntimeException (
367- "Deploy of the package " . $ package ->getPath () . " has failed. "
368- );
374+ $ this ->failed [$ package ->getPath ()]= $ this ->packages [$ package ->getPath ()];
369375 }
370376 return $ isDeployed ;
371377 }
0 commit comments