diff --git a/lib/docker/api.ex b/lib/docker/api.ex index b66315b..3286054 100644 --- a/lib/docker/api.ex +++ b/lib/docker/api.ex @@ -26,7 +26,7 @@ defmodule Testcontainers.Docker.Api do "label" => ["#{Testcontainers.Constants.container_reuse_hash_label}=#{hash}"] } |> Jason.encode!() case Api.Container.container_list(conn, filters: filters_json) do - {:ok, containers} -> + {:ok, containers} when is_list(containers) -> case containers do [] -> {:error, :no_container} @@ -40,12 +40,6 @@ defmodule Testcontainers.Docker.Api do {:ok, %DockerEngineAPI.Model.ErrorResponse{} = error} -> {:error, {:failed_to_get_container, error}} - - {:error, %Tesla.Env{status: other}} -> - {:error, {:http_error, other}} - - {:ok, %DockerEngineAPI.Model.ErrorResponse{} = error} -> - {:error, {:failed_to_get_container, error}} end end