fix: abort running when device connection refused

This commit is contained in:
lilong.129
2023-06-21 22:31:00 +08:00
parent 8aec31193f
commit e1cf7d9679
2 changed files with 5 additions and 1 deletions

View File

@@ -1 +1 @@
v4.3.4-beta-2306212145
v4.3.4-beta-2306212230

View File

@@ -1,6 +1,7 @@
package uixt
import (
"strings"
"time"
"github.com/pkg/errors"
@@ -365,6 +366,9 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
// take screenshot and get screen texts by OCR
imageResult, err := dExt.GetScreenResult()
if err != nil {
if strings.Contains(err.Error(), "connect: connection refused") {
return err
}
log.Error().Err(err).Msg("OCR GetTexts failed")
time.Sleep(3 * time.Second)
continue