MCPcopy
hub / github.com/cortexlabs/cortex / MessageFirstLine

Function MessageFirstLine

pkg/lib/errors/message.go:47–58  ·  view source on GitHub ↗
(err error, strs ...string)

Source from the content-addressed store, hash-verified

45}
46
47func MessageFirstLine(err error, strs ...string) string {
48 wrappedErr := Wrap(err, strs...)
49
50 var errStr string
51 if _, ok := CauseOrSelf(wrappedErr).(awserr.Error); ok {
52 errStr = strings.Split(strings.TrimSpace(wrappedErr.Error()), "\n")[0]
53 } else {
54 errStr = wrappedErr.Error()
55 }
56
57 return strings.TrimSpace(errStr)
58}

Callers 1

shouldBlockFunction · 0.92

Calls 3

WrapFunction · 0.85
CauseOrSelfFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected