feat: add trackings get error code

This commit is contained in:
lilong.129
2023-09-13 19:06:31 +08:00
parent 460d4329f6
commit f1fa87c912
2 changed files with 19 additions and 9 deletions
+4 -2
View File
@@ -162,7 +162,8 @@ func (vc *VideoCrawler) startLiveCrawler(enterPoint PointF) error {
if err != nil || liveRoom.Type != VideoType_Live {
if vc.failedCount >= 3 {
// failed 3 consecutive times
return errors.New("get current live event trackings failed 3 consecutive times")
return errors.Wrap(code.TrackingGetError,
"get current live event trackings failed 3 consecutive times")
}
log.Warn().Int64("failedCount", vc.failedCount).
Msg("get current live room failed")
@@ -265,7 +266,8 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
if err != nil || feedVideo.Type == "" {
if crawler.failedCount >= 10 {
// failed 10 consecutive times
return errors.New("get current feed video failed 10 consecutive times")
return errors.Wrap(code.TrackingGetError,
"get current feed video failed 10 consecutive times")
}
log.Warn().Msg("get current feed video failed")