ShouldCrash returns true if the error should cause the process to crash.
(err error)
| 157 | |
| 158 | // ShouldCrash returns true if the error should cause the process to crash. |
| 159 | func 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. |
| 170 | var WhiteSpace = strings.NewReplacer(" ", "", "\t", "") |
no outgoing calls
no test coverage detected