Skip to content

Commit

Permalink
Fixed open tab on error (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziflex authored Oct 22, 2020
1 parent 9988ebd commit 4bfffa8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/drivers/cdp/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,18 @@ func LoadHTMLPage(
return nil, err
}

closers := make([]io.Closer, 0, 2)
closers := make([]io.Closer, 0, 4)

defer func() {
if err != nil {
if err := client.Page.Close(context.Background()); err != nil {
logger.Error().Err(err)
}

if err := conn.Close(); err != nil {
logger.Error().Err(err)
}

common.CloseAll(logger, closers, "failed to close a Page resource")
}
}()
Expand Down

0 comments on commit 4bfffa8

Please sign in to comment.