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

@ -37,7 +37,8 @@ func GetFilter(
}
localpart, _, err := gomatrixserverlib.SplitID('@', userID)
if err != nil {
return httputil.LogThenError(req, err)
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
return jsonerror.InternalServerError()
}
filter, err := accountDB.GetFilter(req.Context(), localpart, filterID)
@ -74,7 +75,8 @@ func PutFilter(
localpart, _, err := gomatrixserverlib.SplitID('@', userID)
if err != nil {
return httputil.LogThenError(req, err)
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
return jsonerror.InternalServerError()
}
var filter gomatrixserverlib.Filter
@ -93,7 +95,8 @@ func PutFilter(
filterID, err := accountDB.PutFilter(req.Context(), localpart, &filter)
if err != nil {
return httputil.LogThenError(req, err)
util.GetLogger(req.Context()).WithError(err).Error("accountDB.PutFilter failed")
return jsonerror.InternalServerError()
}
return util.JSONResponse{