Skip to content

Commit 5b268cb

Browse files
committed
Handle unexpected Amplitude 404 errors
1 parent 0fe614c commit 5b268cb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/syncer-amplitude/syncer.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ func (syncer *Syncer) Sync() {
6161
endTime := t.Add(PAGINATION_TIME_INTERVAL - time.Hour) // -1 hour to ensure we don't overlap (Amplitude uses an inclusive end time)
6262

6363
err := syncer.Amplitude.Export(jsonQueueWriter, startTime, endTime)
64-
if err != nil && strings.Contains(err.Error(), "Raw data files were not found.") {
65-
common.LogInfo(syncer.Config.CommonConfig, "No data found for the time range", startTime, "to", endTime, "- will retry later.")
66-
break
64+
if err != nil {
65+
if strings.Contains(err.Error(), "Raw data files were not found.") || strings.Contains(err.Error(), "404: Not Found") {
66+
common.LogInfo(syncer.Config.CommonConfig, "No data found for the time range", startTime, "to", endTime, "- will retry later.")
67+
break
68+
}
6769
}
6870
common.PanicIfError(syncer.Config.CommonConfig, err)
6971
}

0 commit comments

Comments
 (0)