1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-01-06 03:03:57 +02:00

Fixed open tab on error (#564)

This commit is contained in:
Tim Voronov 2020-10-21 22:30:58 -04:00 committed by GitHub
parent 9988ebde6f
commit 4bfffa8118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")
}
}()