From 9eb6357d6b468d5990a837ad2a1f60a2ae654d5d Mon Sep 17 00:00:00 2001 From: muXxer Date: Mon, 25 Mar 2024 15:48:22 +0100 Subject: [PATCH] Add error message if deadline was exceeded --- pkg/requesthandler/blockissuance.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/requesthandler/blockissuance.go b/pkg/requesthandler/blockissuance.go index 67dab810c..80b261c54 100644 --- a/pkg/requesthandler/blockissuance.go +++ b/pkg/requesthandler/blockissuance.go @@ -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: @@ -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: