From d1c79acf87437ea03dad9efa5d5002c844d1d927 Mon Sep 17 00:00:00 2001 From: yusing Date: Tue, 27 Jan 2026 00:37:55 +0800 Subject: [PATCH] fix(docker): improve error handling for missing Docker agent Replaced panic with an error return in the NewClient --- internal/docker/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/docker/client.go b/internal/docker/client.go index 5d1cfca9..f151972f 100644 --- a/internal/docker/client.go +++ b/internal/docker/client.go @@ -152,7 +152,7 @@ func NewClient(cfg types.DockerProviderConfig, unique ...bool) (*SharedClient, e if agent.IsDockerHostAgent(host) { a, ok := agentpool.Get(host) if !ok { - panic(fmt.Errorf("agent %q not found", host)) + return nil, fmt.Errorf("agent %q not found", host) } opt = []client.Opt{ client.WithHost(agent.DockerHost),