From c61261a0a1fc37e6b1afb9bfbd724721c97578c6 Mon Sep 17 00:00:00 2001 From: Simon L Date: Tue, 20 Feb 2024 14:39:20 +0100 Subject: [PATCH] log the whole exception if container could not be started Signed-off-by: Simon L --- php/src/Docker/DockerActionManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index cecde9e5..79dd069a 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -186,7 +186,11 @@ class DockerActionManager public function StartContainer(Container $container) : void { $url = $this->BuildApiUrl(sprintf('containers/%s/start', urlencode($container->GetIdentifier()))); - $this->guzzleClient->post($url); + try { + $this->guzzleClient->post($url); + } catch (RequestException $e) { + throw new \Exception("Could not start container " . $container->GetIdentifier() . ": " . $e->getMessage()); + } } public function CreateVolumes(Container $container): void @@ -578,7 +582,7 @@ class DockerActionManager ] ); } catch (RequestException $e) { - throw new \Exception("Could not start container " . $container->GetIdentifier() . ": " . $e->getMessage()); + throw new \Exception("Could not create container " . $container->GetIdentifier() . ": " . $e->getMessage()); } }