Skip to content

Commit

Permalink
Add error message if deadline was exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Mar 25, 2024
1 parent cab5750 commit 9eb6357
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/requesthandler/blockissuance.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ func (r *RequestHandler) submitBlockAndAwaitRetainer(ctx context.Context, block

select {
case <-processingCtx.Done():
if ierrors.Is(processingCtx.Err(), context.DeadlineExceeded) {
return ierrors.Errorf("context deadline exceeded whilst waiting for event on block %s", blockID)
}

return ierrors.Errorf("context canceled whilst waiting for event on block %s", blockID)

case err := <-blockFiltered:
Expand All @@ -117,6 +121,10 @@ func (r *RequestHandler) submitBlockAndAwaitRetainer(ctx context.Context, block
if txRetained != nil {
select {
case <-processingCtx.Done():
if ierrors.Is(processingCtx.Err(), context.DeadlineExceeded) {
return ierrors.Errorf("context deadline exceeded whilst waiting for transaction retained event on block %s", blockID)
}

return ierrors.Errorf("context canceled whilst waiting for transaction retained event on block %s", blockID)

case <-txRetained:
Expand Down

0 comments on commit 9eb6357

Please sign in to comment.