Skip to content

Commit

Permalink
chore(exporter): improve logging when fetching relays-data
Browse files Browse the repository at this point in the history
see: BEDS-90
  • Loading branch information
guybrush committed Oct 18, 2024
1 parent de80c29 commit 284f6c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/pkg/exporter/modules/relays.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ func fetchDeliveredPayloads(r types.Relay, offset uint64) ([]BidTrace, error) {

if err != nil {
log.Error(err, "error retrieving delivered payloads", 0, map[string]interface{}{"relay": r.ID})
return nil, err
return nil, fmt.Errorf("error retrieving delivered payloads for cursor: %v, url: %v: %v", offset, url, err)
}

defer resp.Body.Close()

err = json.NewDecoder(resp.Body).Decode(&payloads)

if err != nil {
return nil, err
return nil, fmt.Errorf("error decoding json for delivered payloads for cursor: %v, url: %v: %v", offset, url, err)
}

return payloads, nil
Expand Down Expand Up @@ -176,7 +176,7 @@ func retrieveAndInsertPayloadsFromRelay(r types.Relay, low_bound uint64, high_bo
for {
resp, err := fetchDeliveredPayloads(r, offset)
if err != nil {
return err
return fmt.Errorf("error calling fetchDeliveredPayloads with offset: %v for relay: %v", r.ID, err)
}

if resp == nil {
Expand Down

0 comments on commit 284f6c5

Please sign in to comment.