MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / handleError

Method handleError

dgraph/cmd/bulk/vector_indexer.go:63–76  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

61// It increments the error count, logs to the error log if enabled, and terminates
62// the process if --ignore_errors is false.
63func (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
78func (vi *vectorIndexer) handleUnmarshalError() {
79 vi.handleError(

Callers 4

handleUnmarshalErrorMethod · 0.95
addVectorEntryMethod · 0.95
waitMethod · 0.95

Calls 3

CheckFunction · 0.92
LogMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected