Skip to content

Commit

Permalink
Merge pull request #160 from matrix-org/dmr/sentry-ignore-malformed-r…
Browse files Browse the repository at this point in the history
…equests

Sentry: don't report incomplete/bad-json requests
  • Loading branch information
David Robertson authored Jun 14, 2023
2 parents c1c0f8f + 48ef621 commit 37087f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sync3/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ func (h *SyncLiveHandler) serve(w http.ResponseWriter, req *http.Request) error
if req.ContentLength != 0 {
defer req.Body.Close()
if err := json.NewDecoder(req.Body).Decode(&requestBody); err != nil {
log.Err(err).Msg("failed to read/decode request body")
internal.GetSentryHubFromContextOrDefault(req.Context()).CaptureException(err)
log.Warn().Err(err).Msg("failed to read/decode request body")
return &internal.HandlerError{
StatusCode: 400,
Err: err,
Expand Down

0 comments on commit 37087f9

Please sign in to comment.