Skip to content

Commit d7fb077

Browse files
[6.x] Improve error handling when requiring starter kits (#14411)
1 parent 71fef71 commit d7fb077

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/StarterKits/Installer.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ protected function prepareRepository(): self
244244
*/
245245
protected function requireStarterKit(): self
246246
{
247+
$error = null;
248+
247249
spin(
248-
function () {
250+
function () use (&$error) {
249251
$version = $this->branch;
250252

251253
// Allow dev stability when installing from VCS repo without tagged releases
@@ -265,12 +267,16 @@ function () {
265267
try {
266268
Composer::withoutQueue()->throwOnFailure()->require($package);
267269
} catch (ProcessException $exception) {
268-
$this->rollbackWithError("Error installing starter kit [{$this->package}].", $exception->getMessage());
270+
$error = $exception;
269271
}
270272
},
271273
"Preparing starter kit [{$this->package}]..."
272274
);
273275

276+
if ($error) {
277+
$this->rollbackWithError("Error installing starter kit [{$this->package}].", $error->getMessage());
278+
}
279+
274280
return $this;
275281
}
276282

0 commit comments

Comments
 (0)