handleError handles errors consistently with the bulk loader's error handling mechanism. It increments the error count, logs to the error log if enabled, and terminates the process if --ignore_errors is false.
(err error, context string, filename string)
| 61 | // It increments the error count, logs to the error log if enabled, and terminates |
| 62 | // the process if --ignore_errors is false. |
| 63 | func (vi *vectorIndexer) handleError(err error, context string, filename string) { |
| 64 | if vi.state == nil { |
| 65 | glog.Errorf("vector indexer error (no state): %v [%s]", err, context) |
| 66 | return |
| 67 | } |
| 68 | atomic.AddInt64(&vi.state.prog.errCount, 1) |
| 69 | if vi.state.errorLog != nil { |
| 70 | vi.state.errorLog.Log(filename, err, context) |
| 71 | } |
| 72 | glog.Errorf("vector indexer error: %v [%s]", err, context) |
| 73 | if !vi.state.opt.IgnoreErrors { |
| 74 | x.Check(err) |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | func (vi *vectorIndexer) handleUnmarshalError() { |
| 79 | vi.handleError( |
no test coverage detected