aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/sendevent.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-03-02 16:20:44 +0000
committerGitHub <noreply@github.com>2020-03-02 16:20:44 +0000
commit59a1f4b8ed94267f4b4ad426192879dc3bef4f1e (patch)
tree4cce1217743d5fdadccefcce9e2716464d90d820 /clientapi/routing/sendevent.go
parent72565f2eeb8988af90590c90c5c8560186db9d62 (diff)
Remove httputil.LogThenError so that the line numbers are reported properly - make error reporting slightly more useful (#879)
Diffstat (limited to 'clientapi/routing/sendevent.go')
-rw-r--r--clientapi/routing/sendevent.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go
index e6de187f..47ad1882 100644
--- a/clientapi/routing/sendevent.go
+++ b/clientapi/routing/sendevent.go
@@ -74,7 +74,8 @@ func SendEvent(
req.Context(), []gomatrixserverlib.Event{*e}, cfg.Matrix.ServerName, txnAndSessionID,
)
if err != nil {
- return httputil.LogThenError(req, err)
+ util.GetLogger(req.Context()).WithError(err).Error("producer.SendEvents failed")
+ return jsonerror.InternalServerError()
}
res := util.JSONResponse{
@@ -121,7 +122,8 @@ func generateSendEvent(
}
err = builder.SetContent(r)
if err != nil {
- resErr := httputil.LogThenError(req, err)
+ util.GetLogger(req.Context()).WithError(err).Error("builder.SetContent failed")
+ resErr := jsonerror.InternalServerError()
return nil, &resErr
}
@@ -133,7 +135,8 @@ func generateSendEvent(
JSON: jsonerror.NotFound("Room does not exist"),
}
} else if err != nil {
- resErr := httputil.LogThenError(req, err)
+ util.GetLogger(req.Context()).WithError(err).Error("common.BuildEvent failed")
+ resErr := jsonerror.InternalServerError()
return nil, &resErr
}