Skip to content

Commit

Permalink
Sentry: don't report incomplete/bad-json requests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Jun 14, 2023
1 parent c1c0f8f commit 48ef621
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 48ef621

Please sign in to comment.