Skip to content

Commit b3d5e8d

Browse files
committed
Swallow status 404 for docker stop with a missing container
1 parent 7cd2563 commit b3d5e8d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api-client/src/main/kotlin/de/gesellix/docker/remote/api/client/ContainerApi.kt

+3
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,9 @@ class ContainerApi(dockerClientConfig: DockerClientConfig = defaultClientConfig,
13881388
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
13891389
ResponseType.ClientError -> {
13901390
val localVarError = localVarResponse as ClientError<*>
1391+
if (localVarError.statusCode == HTTP_NOT_FOUND) {
1392+
return
1393+
}
13911394
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
13921395
}
13931396
ResponseType.ServerError -> {

api-client/src/test/java/de/gesellix/docker/remote/api/client/ContainerApiIntegrationTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ public void containerStartStopWait() {
322322
assertTrue(container.getState().getRunning());
323323

324324
removeContainer(engineApiClient, "container-start-test");
325+
assertDoesNotThrow(() -> containerApi.containerStop("container-start-test", null));
325326
}
326327

327328
@Test

0 commit comments

Comments
 (0)