Merge pull request #5673 from nextcloud/enh/noid/improve-pullimage

DockerActionManager: improve PullImage to always log something if it fails
This commit is contained in:
Simon L. 2024-12-02 10:56:16 +01:00 committed by GitHub
commit 531d239105
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -612,8 +612,11 @@ readonly class DockerActionManager {
try {
$this->guzzleClient->post($url);
} catch (RequestException $e) {
$message = "Could not pull image " . $imageName . ". Please run 'sudo docker exec -it nextcloud-aio-mastercontainer docker pull " . $imageName . "' in order to find out why it failed.";
if ($imageIsThere === false) {
throw new \Exception("Could not pull image " . $imageName . ". Please run 'sudo docker exec -it nextcloud-aio-mastercontainer docker pull " . $imageName . "' in order to find out why it failed.");
throw new \Exception($message);
} else {
error_log($message);
}
}
}