DockerActionManager: improve PullImage to always log something if it fails

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2024-11-28 11:19:40 +01:00
parent f723b7c685
commit 7f229b2414

View file

@ -612,8 +612,11 @@ readonly class DockerActionManager {
try { try {
$this->guzzleClient->post($url); $this->guzzleClient->post($url);
} catch (RequestException $e) { } 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) { 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);
} }
} }
} }