mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-10-25 07:39:31 -04:00
replace panic in antivirus by error
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
1 parent
fd4f8ce758
commit
3d94a65db6
1 file changed
+2
-2
@@ -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":
|
||||
|
||||
Reference in new issue
Block a user