Skip to content

Commit

Permalink
better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Oct 4, 2023
1 parent fd3f70f commit 70e08d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions accountresolver/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ func (p *Processor) processMergeBlocksFiles(ctx context.Context, cursor *Cursor,
return br, nil
})
writerNailer.OnTerminating(func(err error) {
panic(fmt.Errorf("writing bundle file: %w", err))
if err != nil {
panic(fmt.Errorf("writing bundle file: %w", err))
}
})
writerNailer.Start(ctx)

Expand Down Expand Up @@ -240,7 +242,9 @@ func (p *Processor) processMergeBlocksFiles(ctx context.Context, cursor *Cursor,
return b, nil
})
decoderNailer.OnTerminating(func(err error) {
panic(fmt.Errorf("encoding block: %w", err))
if err == nil {
panic(fmt.Errorf("encoding block: %w", err))
}
})
decoderNailer.Start(ctx)

Expand Down

0 comments on commit 70e08d9

Please sign in to comment.