Skip to content

Commit d30caf4

Browse files
committed
Change error handling
1 parent 7431530 commit d30caf4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/methods.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ func RefreshAstraToken(chromedpCtx context.Context) map[string][]string {
142142
chromedp.WaitVisible(`body`, chromedp.ByQuery),
143143
chromedp.ActionFunc(func(ctx context.Context) error {
144144
cookies, err := network.GetCookies().Do(ctx)
145+
if err != nil {
146+
return err
147+
}
145148
gotToken := false
146149
for _, cookie := range cookies {
147150
log.Printf("5.3.1 %s=%s; ", cookie.Name, cookie.Value)
@@ -156,7 +159,7 @@ func RefreshAstraToken(chromedpCtx context.Context) map[string][]string {
156159
if !gotToken {
157160
return errors.New("failed to get a new token")
158161
}
159-
return err
162+
return nil
160163
}),
161164
)
162165
log.Print("5.3.3")

0 commit comments

Comments
 (0)