testcontainers / testcontainers/testcontainers-java

[Enhancement]: Throw specific exception type if no Docker env found

Open
#6,164 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Core

Proposal

Currently, if DockerClientProviderStrategy cannot find a Docker environment on the host, it throws an IllegalStateException. I suggest that this should be a dedicated exception type (extending RuntimeException), so that it can be unambiguously caught and handled.

My use case is to catch that exception and rethrow an org.junit.AssumptionViolatedException if the test is running on an unsupported host. I can catch the IllegalStateException as it stands, but there may other causes of that type, so it's a little ambiguous.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DockerClientProviderStrategy, especially the path taken when no Docker environment is found. Trace its existing exception behavior and repository tests, then verify that this condition has a dedicated RuntimeException type that callers can catch unambiguously.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.