Skip to content

Commit

Permalink
[errors] relax error handling in ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Jun 16, 2018
1 parent 12aca8a commit 800b607
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cmd/cmd_ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func ingestDictionary(r *sybil.Record, recordmap *Dictionary, prefix string) err
sybil.Debug(fmt.Sprintf("TYPE %T IS UNKNOWN FOR FIELD", iv), keyName)
}
if err != nil {
// TODO: consider if there should be a relaxed mode
return errors.Wrap(err, fmt.Sprintf("issue loading %v", keyName))
// TODO: collect error counters?
sybil.Debug("INGEST RECORD ISSUE:", errors.Wrap(err, fmt.Sprintf("issue with record %v", i)))
}
}
return nil
Expand Down Expand Up @@ -128,7 +128,8 @@ func importCsvRecords() error {
}

if err := t.ChunkAndSave(); err != nil {
return err
// TODO: collect error counters?
sybil.Debug("INGEST RECORD ISSUE:", err)
}
}
return nil
Expand Down Expand Up @@ -209,10 +210,12 @@ func importJSONRecords(jsonPath string) error {
err = ingestDictionary(r, &dict, "")
}
if err != nil {
return errors.Wrap(err, fmt.Sprintf("issue with record %v", i))
// TODO: collect error counters?
sybil.Debug("INGEST RECORD ISSUE:", errors.Wrap(err, fmt.Sprintf("issue with record %v", i)))
}
if err := t.ChunkAndSave(); err != nil {
return err
// TODO: collect error counters?
sybil.Debug("INGEST RECORD ISSUE:", err)
}
}

Expand Down

0 comments on commit 800b607

Please sign in to comment.