Skip to content

Commit

Permalink
Gracefully handle 404 when removing container
Browse files Browse the repository at this point in the history
If a container is to be removed - yet doesn't exist anymore, we can gracefully handle the 404 by treating it as though the container had been removed.

Signed-off-by: Sebastian Kirsch  <sebastiankirsch@users.noreply.github.com>
  • Loading branch information
sebastiankirsch authored and rohanKanojia committed Jun 16, 2024
1 parent c1ff71f commit f4de3af
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public void removeContainer(String containerId, boolean removeVolumes)
String url = urlBuilder.removeContainer(containerId, removeVolumes);
log.verbose(Logger.LogVerboseCategory.API, API_LOG_FORMAT_DELETE, url);
try {
delegate.delete(url, HTTP_NO_CONTENT);
delegate.delete(url, HTTP_NO_CONTENT, HTTP_NOT_FOUND);
} catch (IOException e) {
throw new DockerAccessException(e, "Unable to remove container [%s]", containerId);
}
Expand Down

0 comments on commit f4de3af

Please sign in to comment.