mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 21:29:39 +00:00
refactored WaitForHealthCheck strategy and added more granular exceptions
This commit is contained in:
@@ -4,19 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Testcontainers\Exception;
|
||||
|
||||
class ContainerWaitingTimeoutException extends \RuntimeException
|
||||
class ContainerWaitingTimeoutException extends ContainerNotReadyException
|
||||
{
|
||||
protected string $containerId;
|
||||
|
||||
public function __construct(string $containerId, ?string $message = null, ?\Throwable $previous = null)
|
||||
{
|
||||
$this->containerId = $containerId;
|
||||
$message ??= sprintf('Timeout reached while waiting for container %s', $containerId);
|
||||
parent::__construct($message, 0, $previous);
|
||||
parent::__construct($message, $containerId, $previous);
|
||||
}
|
||||
|
||||
public function getContainerId(): string
|
||||
{
|
||||
return $this->containerId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user