Make sure errors are logged for flatstore reader

This commit is contained in:
ionutboangiu
2023-07-14 11:03:25 -04:00
committed by Dan Christian Bogos
parent f2214052b6
commit 78077ae454

View File

@@ -159,8 +159,10 @@ func (rdr *FlatstoreER) processFile(fPath, fName string) (err error) {
} else {
pr, err := NewUnpairedRecord(record, rdr.Config().Timezone, fName)
if err != nil {
fmt.Sprintf("<%s> Converting row : <%s> to unpairedRecord , ignoring due to error: <%s>",
utils.ERs, record, err.Error())
utils.Logger.Err(
fmt.Sprintf("<%s> Converting row : <%s> to unpairedRecord , ignoring due to error: <%s>",
utils.ERs, record, err.Error()),
)
continue
}
if val, has := rdr.cache.Get(pr.OriginID); !has {
@@ -170,8 +172,10 @@ func (rdr *FlatstoreER) processFile(fPath, fName string) (err error) {
pair := val.(*UnpairedRecord)
record, err = pairToRecord(pair, pr)
if err != nil {
fmt.Sprintf("<%s> Merging unpairedRecords : <%s> and <%s> to record , ignoring due to error: <%s>",
utils.ERs, utils.ToJSON(pair), utils.ToJSON(pr), err.Error())
utils.Logger.Err(
fmt.Sprintf("<%s> Merging unpairedRecords : <%s> and <%s> to record , ignoring due to error: <%s>",
utils.ERs, utils.ToJSON(pair), utils.ToJSON(pr), err.Error()),
)
continue
}
rdr.cache.Remove(pr.OriginID)