From a3ac8f2eadb9f9777cdaca72d375c7eef8d7fe28 Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:44:02 +0200 Subject: [PATCH] Check that at least one sink is running --- sinks/sinkManager.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sinks/sinkManager.go b/sinks/sinkManager.go index f531f5d..6af8614 100644 --- a/sinks/sinkManager.go +++ b/sinks/sinkManager.go @@ -76,11 +76,17 @@ func (sm *sinkManager) Init(wg *sync.WaitGroup, sinkConfigFile string) error { for name, raw := range rawConfigs { err = sm.AddOutput(name, raw) if err != nil { - cclog.ComponentError("SinkManager", err.Error()) + cclog.ComponentError("SinkManager", err) continue } } + // Check that at least one sink is running + if !(len(sm.sinks) > 0) { + cclog.ComponentError("SinkManager", "Found no usable sinks") + return fmt.Errorf("Found no usable sinks") + } + return nil }