testcontainers / testcontainers/testcontainers-java
[Enhancement]: Throw specific exception type if no Docker env found
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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