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:
parent
9988ebde6f
commit
4bfffa8118
@ -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")
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user