MCPcopy
hub / github.com/dgraph-io/dgraph / ShouldCrash

Function ShouldCrash

x/x.go:159–167  ·  view source on GitHub ↗

ShouldCrash returns true if the error should cause the process to crash.

(err error)

Source from the content-addressed store, hash-verified

157
158// ShouldCrash returns true if the error should cause the process to crash.
159func ShouldCrash(err error) bool {
160 if err == nil {
161 return false
162 }
163 errStr := status.Convert(err).Message()
164 return strings.Contains(errStr, "REUSE_RAFTID") ||
165 strings.Contains(errStr, "REUSE_ADDR") ||
166 strings.Contains(errStr, "NO_ADDR")
167}
168
169// WhiteSpace Replacer removes spaces and tabs from a string.
170var WhiteSpace = strings.NewReplacer(" ", "", "\t", "")

Callers 2

initAndStartNodeMethod · 0.92
StartRaftNodesFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected