Преглед на файлове

增强 rod_helper 的日志输出

Signed-off-by: allan716 <[email protected]>
allan716 преди 3 години
родител
ревизия
c5ede89c6e
променени са 1 файла, в които са добавени 8 реда и са изтрити 7 реда
  1. 8 7
      internal/pkg/rod_helper/rodHelper.go

+ 8 - 7
internal/pkg/rod_helper/rodHelper.go

@@ -4,6 +4,12 @@ import (
 	"context"
 	_ "embed"
 	"errors"
+	"os"
+	"path/filepath"
+	"strings"
+	"sync"
+	"time"
+
 	"github.com/allanpk716/ChineseSubFinder/internal/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/internal/pkg/my_folder"
 	"github.com/allanpk716/ChineseSubFinder/internal/pkg/my_util"
@@ -14,11 +20,6 @@ import (
 	"github.com/go-rod/rod/lib/proto"
 	"github.com/mholt/archiver/v3"
 	"github.com/sirupsen/logrus"
-	"os"
-	"path/filepath"
-	"strings"
-	"sync"
-	"time"
 )
 
 func NewBrowserEx(log *logrus.Logger, loadAdblock bool, _settings *settings.Settings, preLoadUrl ...string) (*rod.Browser, error) {
@@ -62,8 +63,8 @@ func NewBrowser(log *logrus.Logger, localChromeFPath, httpProxyURL string, loadA
 	if localChromeFPath != "" {
 		// 如果有指定的 chrome 路径,则使用指定的 chrome 路径
 		if my_util.IsFile(localChromeFPath) == false {
-			log.Errorln(errors.New("localChromeFPath is not a file"))
-			panic(errors.New("localChromeFPath is not a file"))
+			log.Errorln(errors.New("localChromeFPath is not a file, localChromePath:" + localChromeFPath))
+			panic(errors.New("localChromeFPath is not a file, localChromePath:" + localChromeFPath))
 		}
 		err = rod.Try(func() {
 			purl := ""