Message returns just the Err.Error() string, if present, or the Kind string description. The intent is to allow srverr users a way to avoid embedding the Kind description as happens with Error().
()
| 87 | // string description. The intent is to allow srverr users a way to avoid |
| 88 | // embedding the Kind description as happens with Error(). |
| 89 | func (e *Error) Message() string { |
| 90 | if e.Err != nil { |
| 91 | return e.Err.Error() |
| 92 | } |
| 93 | if e.Kind != Other { |
| 94 | return e.Kind.String() |
| 95 | } |
| 96 | return "no error" |
| 97 | } |
| 98 | |
| 99 | // Function E generates an error from any mix of: |
| 100 | // - a Kind |