Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //// If in error state
- //if h.es.state {
- // // Record has error
- // if err != nil {
- // // Error record with invalid parent: Skip
- // if isChildOfErrRecord(h.es.level, p.Level) {
- // h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Error("%s", p.FindFirstErrorInFields())
- // return &ParseError{Err: err}
- // }
- //
- // h.es.level = p.Level
- // h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Error("%s", p.FindFirstErrorInFields())
- // // Write error record to file and return any error. If no errors, return ParseError.
- // err2 := h.onProcessed(p)
- // if err2 != nil {
- // return err
- // }
- // return &ParseError{Err: err}
- // }
- // // Non-error record with invalid parent: Skip
- // if isChildOfErrRecord(h.es.level, p.Level) {
- // h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Trace("Skip parsing of %s record due to parent record error", p.RecordKey)
- // return nil
- // }
- //
- // if isSiblingOrParentOfErrRecord(h.es.level, p.Level) {
- // h.es.state = false
- // return h.onProcessed(p)
- // }
- //
- // h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Trace("Skip parsing of %s record due to parent record error", p.RecordKey)
- // return nil
- //}
- //
- //// If not in error state
- //// Record has error
- //if err != nil {
- // h.es.state = true
- // h.es.level = p.Level
- // h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Error("%s", p.FindFirstErrorInFields())
- // // Write error record to file and return any error. If no errors, return ParseError.
- // err2 := h.onProcessed(p)
- // if err2 != nil {
- // return err
- // }
- // return &ParseError{Err: err}
- //}
- //
- //return h.onProcessed(p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement