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]>
  • Loading branch information
szaimen committed Jan 20, 2025
1 parent 2992198 commit 72f91b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ 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());
error_log("Could not start container " . $container->GetIdentifier() . ": " . $e->getMessage());
throw $e;
}
}

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

}
Expand Down Expand Up @@ -883,7 +885,8 @@ 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());
error_log("Could not create the nextcloud-aio network: " . $e->getMessage());
throw $e;
}
}
}
Expand Down

0 comments on commit 72f91b4

Please sign in to comment.