replace panic in antivirus by error

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-10-14 16:19:28 +02:00
parent fd4f8ce758
commit 3d94a65db6
@@ -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":