Return a common error message when testing the oidc provider

Returning a common error when failed to test the oidc provider and printing the detail in the log

Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
Wenkai Yin 2019-09-23 13:11:10 +08:00
parent 63373c8ef9
commit 6efdfa5fb4

View File

@ -16,6 +16,7 @@ package api
import (
"errors"
"github.com/goharbor/harbor/src/common/utils/log"
"github.com/goharbor/harbor/src/common/utils/oidc"
)
@ -50,7 +51,7 @@ func (oa *OIDCAPI) Ping() {
}
if err := oidc.TestEndpoint(c); err != nil {
log.Errorf("Failed to verify connection: %+v, err: %v", c, err)
oa.SendBadRequestError(err)
oa.SendBadRequestError(errors.New("failed to verify connection"))
return
}
}