Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 2.03 KB | None | 0 0
  1.     //// If in error state
  2.     //if h.es.state {
  3.     //  // Record has error
  4.     //  if err != nil {
  5.     //      // Error record with invalid parent: Skip
  6.     //      if isChildOfErrRecord(h.es.level, p.Level) {
  7.     //          h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Error("%s", p.FindFirstErrorInFields())
  8.     //          return &ParseError{Err: err}
  9.     //      }
  10.     //
  11.     //      h.es.level = p.Level
  12.     //      h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Error("%s", p.FindFirstErrorInFields())
  13.     //      // Write error record to file and return any error. If no errors, return ParseError.
  14.     //      err2 := h.onProcessed(p)
  15.     //      if err2 != nil {
  16.     //          return err
  17.     //      }
  18.     //      return &ParseError{Err: err}
  19.     //  }
  20.     //  // Non-error record with invalid parent: Skip
  21.     //  if isChildOfErrRecord(h.es.level, p.Level) {
  22.     //      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)
  23.     //      return nil
  24.     //  }
  25.     //
  26.     //  if isSiblingOrParentOfErrRecord(h.es.level, p.Level) {
  27.     //      h.es.state = false
  28.     //      return h.onProcessed(p)
  29.     //  }
  30.     //
  31.     //  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)
  32.     //  return nil
  33.     //}
  34.     //
  35.     //// If not in error state
  36.     //// Record has error
  37.     //if err != nil {
  38.     //  h.es.state = true
  39.     //  h.es.level = p.Level
  40.     //  h.lg.CreateChildWithFields(map[string]interface{}{"input": p.InputText, "parent record": getParent(h.es.level, h.parentInputText)}).Error("%s", p.FindFirstErrorInFields())
  41.     //  // Write error record to file and return any error. If no errors, return ParseError.
  42.     //  err2 := h.onProcessed(p)
  43.     //  if err2 != nil {
  44.     //      return err
  45.     //  }
  46.     //  return &ParseError{Err: err}
  47.     //}
  48.     //
  49.     //return h.onProcessed(p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement