From 7f229b241449c609b8670ce04a3f597b80fed58b Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Thu, 28 Nov 2024 11:19:40 +0100 Subject: [PATCH] DockerActionManager: improve PullImage to always log something if it fails Signed-off-by: Simon L. --- php/src/Docker/DockerActionManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 29866965966..e3d782123f0 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -612,8 +612,11 @@ public function PullImage(Container $container) : void 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); } } }