Remove httputil.LogThenError so that the line numbers are reported properly - make error reporting slightly more useful (#879)

This commit is contained in:
Neil Alexander 2020-03-02 16:20:44 +00:00 committed by GitHub
parent 72565f2eeb
commit 59a1f4b8ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 302 additions and 178 deletions

View file

@ -19,7 +19,6 @@ import (
"strconv"
"time"
"github.com/matrix-org/dendrite/clientapi/httputil"
"github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/common/config"
"github.com/matrix-org/dendrite/roomserver/api"
@ -72,12 +71,14 @@ func Backfill(
ServerName: request.Origin(),
}
if req.Limit, err = strconv.Atoi(limit); err != nil {
return httputil.LogThenError(httpReq, err)
util.GetLogger(httpReq.Context()).WithError(err).Error("strconv.Atoi failed")
return jsonerror.InternalServerError()
}
// Query the roomserver.
if err = query.QueryBackfill(httpReq.Context(), &req, &res); err != nil {
return httputil.LogThenError(httpReq, err)
util.GetLogger(httpReq.Context()).WithError(err).Error("query.QueryBackfill failed")
return jsonerror.InternalServerError()
}
// Filter any event that's not from the requested room out.