mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-12 04:30:04 +00:00
Log with field error instead of err (#7998)
This commit is contained in:
parent
a13de7da11
commit
9a1423d62d
@ -110,7 +110,7 @@ func (s *Service) processFetchedData(
|
||||
|
||||
// Use Batch Block Verify to process and verify batches directly.
|
||||
if err := s.processBatchedBlocks(ctx, genesis, data.blocks, s.chain.ReceiveBlockBatch); err != nil {
|
||||
log.WithField("err", err.Error()).Warn("Batch is not processed")
|
||||
log.WithError(err).Warn("Batch is not processed")
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,20 +125,20 @@ func (s *Service) processFetchedDataRegSync(
|
||||
if err := s.processBlock(ctx, genesis, blk, blockReceiver); err != nil {
|
||||
switch {
|
||||
case errors.Is(err, errBlockAlreadyProcessed):
|
||||
log.WithField("err", err.Error()).Debug("Block is not processed")
|
||||
log.WithError(err).Debug("Block is not processed")
|
||||
invalidBlocks++
|
||||
case errors.Is(err, errParentDoesNotExist):
|
||||
log.WithField("err", err.Error()).Debug("Block is not processed")
|
||||
log.WithError(err).Debug("Block is not processed")
|
||||
invalidBlocks++
|
||||
default:
|
||||
log.WithField("err", err.Error()).Warn("Block is not processed")
|
||||
log.WithError(err).Warn("Block is not processed")
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
// Add more visible logging if all blocks cannot be processed.
|
||||
if len(data.blocks) == invalidBlocks {
|
||||
log.WithField("err", "Range had no valid blocks to process").Warn("Range is not processed")
|
||||
log.WithField("error", "Range had no valid blocks to process").Warn("Range is not processed")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user