Merge pull request #11588 from wy65701436/trace-error

update trace level to error
This commit is contained in:
Wenkai Yin(尹文开) 2020-04-14 18:30:21 +08:00 committed by GitHub
commit 2d618370ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {