diff --git a/app/peerfinder/http.go b/app/peerfinder/http.go index 7776434..15ba42d 100644 --- a/app/peerfinder/http.go +++ b/app/peerfinder/http.go @@ -435,8 +435,8 @@ func (s *service) postResult(w http.ResponseWriter, r *http.Request, reqID strin err := s.state.Use(ctx, func(ctx context.Context, state *state) error { var ok bool if _, ok = state.peers[peerID]; !ok { - log.Printf("peer not found: %s\n", peerID) - return fmt.Errorf("peer not found: %s", peerID) + log.Printf("peer not found: req=%s peer=%s\n", reqID, peerID) + return fmt.Errorf("peer not found: req=%s peer=%s", reqID, peerID) } return nil @@ -450,8 +450,8 @@ func (s *service) postResult(w http.ResponseWriter, r *http.Request, reqID strin peerResults := &PeerResults{} peerResults.SetStreamID(aggPeer(peerID)) err = s.es.Load(ctx, peerResults) - if err != nil { - span.RecordError(fmt.Errorf("peer not found: %w", err)) + if err != nil && !errors.Is(err, ev.ErrNotFound) { + span.RecordError(fmt.Errorf("peer not found: req=%s peer=%s %w", reqID, peerID, err)) w.WriteHeader(http.StatusNotFound) return }