mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 06:28:06 +01:00
Merge pull request #9198 from ywk253100/190923_ping
Return the common error message when testing the webhook endpoint
This commit is contained in:
commit
360334991e
@ -7,6 +7,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/goharbor/harbor/src/common/utils/log"
|
||||
|
||||
"github.com/goharbor/harbor/src/common/models"
|
||||
"github.com/goharbor/harbor/src/common/rbac"
|
||||
"github.com/goharbor/harbor/src/common/utils"
|
||||
@ -273,7 +275,8 @@ func (w *NotificationPolicyAPI) Test() {
|
||||
}
|
||||
|
||||
if err := notification.PolicyMgr.Test(policy); err != nil {
|
||||
w.SendBadRequestError(fmt.Errorf("notification policy %s test failed: %v", policy.Name, err))
|
||||
log.Errorf("notification policy %s test failed: %v", policy.Name, err)
|
||||
w.SendBadRequestError(fmt.Errorf("notification policy %s test failed", policy.Name))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user