Skip to content

Commit

Permalink
Update the error message to work with context err
Browse files Browse the repository at this point in the history
Co-authored-by: İnanç Gümüş <[email protected]>
  • Loading branch information
ankur22 and inancgumus committed Sep 26, 2023
1 parent 06ca576 commit 41b5d7f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/browser_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package common

import (
"context"
"errors"
"fmt"
"net/url"
"reflect"
Expand Down Expand Up @@ -386,7 +385,7 @@ func (b *BrowserContext) waitForEvent(

select {
case <-b.ctx.Done():
return nil, errors.New("test iteration ended")
return nil, b.ctx.Err() //nolint:wrapcheck
case <-time.After(timeout):
b.logger.Debugf("BrowserContext:WaitForEvent:timeout", "bctxid:%v event:%q", b.id, event)
return nil, fmt.Errorf("waitForEvent timed out after %v", timeout)
Expand Down

0 comments on commit 41b5d7f

Please sign in to comment.