mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-01-01 03:22:48 +08:00
don't crash during container removal if the container doesn't exist
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
892590275f
commit
51d55760fa
1 changed files with 9 additions and 3 deletions
|
@ -125,7 +125,11 @@ class DockerActionManager
|
||||||
$url = $this->BuildApiUrl(sprintf('containers/%s', urlencode($container->GetIdentifier())));
|
$url = $this->BuildApiUrl(sprintf('containers/%s', urlencode($container->GetIdentifier())));
|
||||||
try {
|
try {
|
||||||
$this->guzzleClient->delete($url);
|
$this->guzzleClient->delete($url);
|
||||||
} catch (\Exception $e) {}
|
} catch (ClientException $e) {
|
||||||
|
if ($e->getCode() !== 404) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetLogs(Container $container) : string
|
public function GetLogs(Container $container) : string
|
||||||
|
@ -426,7 +430,7 @@ class DockerActionManager
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} catch (ServerException $e) {}
|
} catch (ClientException $e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function ConnectContainerIdToNetwork(string $id)
|
private function ConnectContainerIdToNetwork(string $id)
|
||||||
|
@ -482,7 +486,9 @@ class DockerActionManager
|
||||||
|
|
||||||
public function StopContainer(Container $container) {
|
public function StopContainer(Container $container) {
|
||||||
$url = $this->BuildApiUrl(sprintf('containers/%s/stop?t=%s', urlencode($container->GetIdentifier()), $container->GetMaxShutdownTime()));
|
$url = $this->BuildApiUrl(sprintf('containers/%s/stop?t=%s', urlencode($container->GetIdentifier()), $container->GetMaxShutdownTime()));
|
||||||
$this->guzzleClient->post($url);
|
try {
|
||||||
|
$this->guzzleClient->post($url);
|
||||||
|
} catch (\Exception $e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetBackupcontainerExitCode() : int
|
public function GetBackupcontainerExitCode() : int
|
||||||
|
|
Loading…
Reference in a new issue