Skip to content

Commit

Permalink
individualize error message for better traceability
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Aug 15, 2023
1 parent f532f61 commit 68fe3fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func GetBlocksForSlots(firstSlot uint64, lastSlot uint64, withOrphaned bool) []*
ORDER BY slot DESC
`, firstSlot, lastSlot)
if err != nil {
logger.Errorf("Error while fetching blocks: %v", err)
logger.Errorf("Error while fetching blocks for slot: %v", err)
return nil
}
return blocks
Expand Down Expand Up @@ -469,7 +469,7 @@ func GetBlocksWithGraffiti(graffiti string, firstSlot uint64, offset uint64, lim
LIMIT $3 OFFSET $4`,
}), "%"+graffiti+"%", firstSlot, limit, offset)
if err != nil {
logger.Errorf("Error while fetching blocks: %v", err)
logger.Errorf("Error while fetching blocks with graffiti: %v", err)
return nil
}
return blocks
Expand Down Expand Up @@ -500,7 +500,7 @@ func GetAssignedBlocks(proposer uint64, firstSlot uint64, offset uint64, limit u
`)
rows, err := ReaderDb.Query(sql.String(), proposer, firstSlot, limit, offset)
if err != nil {
logger.Errorf("Error while fetching blocks: %v", err)
logger.Errorf("Error while fetching assigned blocks: %v", err)
return nil
}

Expand All @@ -512,7 +512,7 @@ func GetAssignedBlocks(proposer uint64, firstSlot uint64, offset uint64, limit u
}
err := rows.Scan(scanArgs...)
if err != nil {
logger.Errorf("Error while parsing block: %v", err)
logger.Errorf("Error while parsing assigned block: %v", err)
continue
}

Expand Down

0 comments on commit 68fe3fd

Please sign in to comment.