Merge pull request #9198 from ywk253100/190923_ping

Return the common error message when testing the webhook endpoint
This commit is contained in:
Wenkai Yin(尹文开) 2019-09-24 18:51:21 +08:00 committed by GitHub
commit 360334991e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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
}
}