From 3d94a65db649a3d73e274e547215a209df37c80c Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Mon, 14 Oct 2024 16:19:28 +0200 Subject: [PATCH] replace panic in antivirus by error Signed-off-by: Christian Richter --- services/antivirus/pkg/server/debug/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/antivirus/pkg/server/debug/server.go b/services/antivirus/pkg/server/debug/server.go index 521434f0c..73009607d 100644 --- a/services/antivirus/pkg/server/debug/server.go +++ b/services/antivirus/pkg/server/debug/server.go @@ -2,6 +2,7 @@ package debug import ( "context" + "errors" "net/http" "github.com/dutchcoders/go-clamd" @@ -27,8 +28,7 @@ func Server(opts ...Option) (*http.Server, error) { cfg := options.Config switch cfg.Scanner.Type { default: - // there is not av configured, so we panic - panic("no antivirus configured") + return errors.New("no antivirus configured") case "clamav": return clamd.NewClamd(cfg.Scanner.ClamAV.Socket).Ping() case "icap":