From b3eea2048ee3bc86d7c6b0a5b608a2545a6825dc Mon Sep 17 00:00:00 2001 From: bui Date: Fri, 30 Apr 2021 16:59:06 +0200 Subject: [PATCH] up --- cmd/crowdsec/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/crowdsec/main.go b/cmd/crowdsec/main.go index 9292f11bc..be7c4f72a 100644 --- a/cmd/crowdsec/main.go +++ b/cmd/crowdsec/main.go @@ -17,6 +17,7 @@ import ( leaky "github.com/crowdsecurity/crowdsec/pkg/leakybucket" "github.com/crowdsecurity/crowdsec/pkg/parser" "github.com/crowdsecurity/crowdsec/pkg/types" + "github.com/pkg/errors" log "github.com/sirupsen/logrus" @@ -143,11 +144,13 @@ func LoadAcquisition(cConfig *csconfig.Config) error { } dataSources, err = acquisition.LoadAcquisitionFromDSN(flags.OneShotDSN, flags.SingleFileType) - + if err != nil { + return errors.Wrapf(err, "failed to configure datasource for %s", flags.OneShotDSN) + } } else { dataSources, err = acquisition.LoadAcquisitionFromFile(cConfig.Crowdsec) if err != nil { - log.Fatalf("While loading acquisition configuration : %s", err) + return errors.Wrap(err, "while loading acquisition configuration") } }