update trace level to error

Use level error instead to log trace

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
wang yan 2020-04-13 14:28:55 +08:00
parent adb305e4e1
commit 7622c17817

View File

@ -50,8 +50,7 @@ func SendError(w http.ResponseWriter, err error) {
statusCode, errPayload, stackTrace := apiError(err)
// the error detail is logged only, and will not be sent to the client to avoid leaking server information
if statusCode >= http.StatusInternalServerError {
log.Error(errPayload)
log.Debug(stackTrace)
log.Errorf("%s %s", errPayload, stackTrace)
err = errors.New(nil).WithCode(errors.GeneralCode).WithMessage("internal server error")
errPayload = errors.NewErrs(err).Error()
} else {