From 5e9225154eef674caaa524a9baf7a3d8d40967f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Thu, 31 Aug 2023 21:59:31 +0200 Subject: [PATCH 1/2] Improve the error message when Docker is not running Before this commit, the error message implied that there was a configuration error while it could simply be that Docker was not running. --- src/Testcontainers/Builders/AbstractBuilder`4.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testcontainers/Builders/AbstractBuilder`4.cs b/src/Testcontainers/Builders/AbstractBuilder`4.cs index 5729430fb..bc5854762 100644 --- a/src/Testcontainers/Builders/AbstractBuilder`4.cs +++ b/src/Testcontainers/Builders/AbstractBuilder`4.cs @@ -126,7 +126,7 @@ protected virtual TBuilderEntity Init() /// Thrown when a mandatory Docker resource configuration is not set. protected virtual void Validate() { - const string message = "Cannot detect the Docker endpoint. Use either the environment variables or the ~/.testcontainers.properties file to customize your configuration:\nhttps://dotnet.testcontainers.org/custom_configuration/"; + const string message = "Docker is either not running or misconfigured. Please ensure that Docker is running and that the endpoint is properly configured. The environment variables or the ~/.testcontainers.properties file can be used to customize your configuration:\nhttps://dotnet.testcontainers.org/custom_configuration/"; _ = Guard.Argument(DockerResourceConfiguration.DockerEndpointAuthConfig, nameof(IResourceConfiguration.DockerEndpointAuthConfig)) .ThrowIf(argument => argument.Value == null, argument => new ArgumentException(message, argument.Name)); } From 77063c32cdc13e49e0e60a6f798041ebff0e7ae4 Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:40:40 +0200 Subject: [PATCH 2/2] Update src/Testcontainers/Builders/AbstractBuilder`4.cs --- src/Testcontainers/Builders/AbstractBuilder`4.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testcontainers/Builders/AbstractBuilder`4.cs b/src/Testcontainers/Builders/AbstractBuilder`4.cs index bc5854762..70d45fa2a 100644 --- a/src/Testcontainers/Builders/AbstractBuilder`4.cs +++ b/src/Testcontainers/Builders/AbstractBuilder`4.cs @@ -126,7 +126,7 @@ protected virtual TBuilderEntity Init() /// Thrown when a mandatory Docker resource configuration is not set. protected virtual void Validate() { - const string message = "Docker is either not running or misconfigured. Please ensure that Docker is running and that the endpoint is properly configured. The environment variables or the ~/.testcontainers.properties file can be used to customize your configuration:\nhttps://dotnet.testcontainers.org/custom_configuration/"; + const string message = "Docker is either not running or misconfigured. Please ensure that Docker is running and that the endpoint is properly configured. You can customize your configuration using either the environment variables or the ~/.testcontainers.properties file. For more information, visit:\nhttps://dotnet.testcontainers.org/custom_configuration/"; _ = Guard.Argument(DockerResourceConfiguration.DockerEndpointAuthConfig, nameof(IResourceConfiguration.DockerEndpointAuthConfig)) .ThrowIf(argument => argument.Value == null, argument => new ArgumentException(message, argument.Name)); }