From 6c8866de6f2b32c55a569dadb22f59d34167ef74 Mon Sep 17 00:00:00 2001 From: wenjie Date: Sat, 28 Feb 2026 16:04:44 +0800 Subject: [PATCH] fix: propagate error when no channels are enabled during startup (#897) --- cmd/picoclaw/internal/gateway/helpers.go | 1 + pkg/channels/manager.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/picoclaw/internal/gateway/helpers.go b/cmd/picoclaw/internal/gateway/helpers.go index baa489b92..da87f0adf 100644 --- a/cmd/picoclaw/internal/gateway/helpers.go +++ b/cmd/picoclaw/internal/gateway/helpers.go @@ -175,6 +175,7 @@ func gatewayCmd(debug bool) error { if err := channelManager.StartAll(ctx); err != nil { fmt.Printf("Error starting channels: %v\n", err) + return err } fmt.Printf("✓ Health endpoints available at http://%s:%d/health and /ready\n", cfg.Gateway.Host, cfg.Gateway.Port) diff --git a/pkg/channels/manager.go b/pkg/channels/manager.go index 31af9672c..155e50b39 100644 --- a/pkg/channels/manager.go +++ b/pkg/channels/manager.go @@ -313,7 +313,7 @@ func (m *Manager) StartAll(ctx context.Context) error { if len(m.channels) == 0 { logger.WarnC("channels", "No channels enabled") - return nil + return errors.New("no channels enabled") } logger.InfoC("channels", "Starting all channels")