diff --git a/cli/ValetPlus/AbstractDockerService.php b/cli/ValetPlus/AbstractDockerService.php index 388de3b8..1333a622 100644 --- a/cli/ValetPlus/AbstractDockerService.php +++ b/cli/ValetPlus/AbstractDockerService.php @@ -9,7 +9,7 @@ use Valet\CommandLine; use Valet\Filesystem; use function Valet\info; -use function Valet\output; +use function Valet\warning; /** * Docker container service. Please note that container names are restricted to the following characters [a-zA-Z0-9][a-zA-Z0-9_.-]. @@ -50,9 +50,7 @@ public function getAllRunningContainers(): Collection { $command = 'docker ps --format=\'{{.Names}}\''; $onError = function ($exitCode, $errorOutput) { - output($errorOutput); - - throw new DomainException('Docker was unable to check which containers are running.'); + warning($errorOutput); }; return collect(array_filter(explode(PHP_EOL, $this->cli->runAsUser($command, $onError)))); @@ -67,9 +65,13 @@ public function getAllRunningContainers(): Collection */ public function runCommand($command, $dir) { + $onError = function ($exitCode, $errorOutput) { + warning($errorOutput); + }; + $cwd = getcwd(); @chdir($dir); - $this->cli->runAsUser($command); + $this->cli->runAsUser($command, $onError); @chdir($cwd); return $this;