Skip to content

Commit

Permalink
DockerActionManager: improve the logging
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>

Revert "DockerActionManager: improve the logging"

This reverts commit 72f91b4.

df
  • Loading branch information
szaimen committed Jan 21, 2025
1 parent 2992198 commit cf63d3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion php/src/Controller/DockerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private function PerformRecursiveContainerStart(string $id, bool $pullImage = tr
if ($pullImage) {
if (!$this->dockerActionManager->isDockerHubReachable($container)) {
$pullImage = false;
error_log('Not pulling the image for the ' . $container->GetContainerName() . ' container because docker hub does not seem to be reachable.');
error_log('Not pulling the ' . $container->GetContainerName() . ' image for the ' . $container->GetIdentifier() . ' container because docker hub does not seem to be reachable.');
}
}

Expand Down
8 changes: 4 additions & 4 deletions php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function StartContainer(Container $container) : void {
try {
$this->guzzleClient->post($url);
} catch (RequestException $e) {
throw new \Exception("Could not start container " . $container->GetIdentifier() . ": " . $e->getMessage());
throw new \Exception("Could not start container " . $container->GetIdentifier() . ": " . $e->getResponse()->getBody()->getContents());
}
}

Expand Down Expand Up @@ -588,7 +588,7 @@ public function CreateContainer(Container $container) : void {
]
);
} catch (RequestException $e) {
throw new \Exception("Could not create container " . $container->GetIdentifier() . ": " . $e->getMessage());
throw new \Exception("Could not create container " . $container->GetIdentifier() . ": " . $e->getResponse()->getBody()->getContents());
}

}
Expand Down Expand Up @@ -623,7 +623,7 @@ 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.";
$message = "Could not pull image " . $imageName . ": " . $e->getResponse()->getBody()->getContents();
if ($imageIsThere === false) {
throw new \Exception($message);
} else {
Expand Down Expand Up @@ -883,7 +883,7 @@ private function ConnectContainerIdToNetwork(string $id, string $internalPort, s
} catch (RequestException $e) {
// 409 is undocumented and gets thrown if the network already exists.
if ($e->getCode() !== 409) {
throw new \Exception("Could not create the nextcloud-aio network: " . $e->getMessage());
throw new \Exception("Could not create the nextcloud-aio network: " . $e->getResponse()->getBody()->getContents());
}
}
}
Expand Down

0 comments on commit cf63d3f

Please sign in to comment.