Commit 058c796f authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #7434 from ethereum-optimism/aj/error-msg

op-challenger: Include game address in error message instead of listing all games
parents b5095f27 271f79c5
......@@ -62,7 +62,7 @@ func (c *coordinator) schedule(ctx context.Context, games []common.Address) erro
// data directories potentially being deleted for games that are required.
for _, addr := range games {
if j, err := c.createJob(addr); err != nil {
errs = append(errs, err)
errs = append(errs, fmt.Errorf("failed to create job for game %v: %w", addr, err))
} else if j != nil {
jobs = append(jobs, *j)
c.m.RecordGameUpdateScheduled()
......@@ -85,7 +85,9 @@ func (c *coordinator) schedule(ctx context.Context, games []common.Address) erro
// Finally, enqueue the jobs
for _, j := range jobs {
errs = append(errs, c.enqueueJob(ctx, j))
if err := c.enqueueJob(ctx, j); err != nil {
errs = append(errs, fmt.Errorf("failed to enqueue job for game %v: %w", j.addr, err))
}
}
return errors.Join(errs...)
}
......
......@@ -101,7 +101,7 @@ func (s *Scheduler) loop(ctx context.Context) {
return
case games := <-s.scheduleQueue:
if err := s.coordinator.schedule(ctx, games); err != nil {
s.logger.Error("Failed to schedule game updates", "games", games, "err", err)
s.logger.Error("Failed to schedule game updates", "err", err)
}
case j := <-s.resultQueue:
if err := s.coordinator.processResult(j); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment