log the whole exception if container could not be started

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2024-02-20 14:39:20 +01:00
parent 4a121ed613
commit c61261a0a1

View file

@ -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());
}
}