Skip to content

Commit e482226

Browse files
committed
Enhanced error handling in PackageUpdateCommand
1 parent d1130a1 commit e482226

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/commands/PackageUpdateCommand.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ public function run()
2121
$this->packageRepository->insert($this->package);
2222
}
2323
} else {
24-
$this->package->update();
25-
$this->packageRepository->save($this->packages);
24+
try {
25+
$this->package->update();
26+
$this->packageRepository->save($this->packages);
27+
} catch (\Exception $e) {
28+
Yii::error('Failed to update package "' . $this->package->getFullName() . '": ' . $e->getMessage(), __CLASS__);
29+
throw $e;
30+
}
31+
32+
Yii::$app->queue->push('package', Yii::createObject(CollectDependenciesCommand::class, [$this->package]));
2633
}
2734

28-
Yii::$app->queue->push('package', Yii::createObject(CollectDependenciesCommand::class, [$this->package]));
2935

3036
$this->afterRun();
3137
}

0 commit comments

Comments
 (0)