(err error, strs ...string)
| 71 | } |
| 72 | |
| 73 | func Wrap(err error, strs ...string) error { |
| 74 | if err == nil { |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | cortexError := WithStack(err).(*Error) |
| 79 | |
| 80 | strs = removeEmptyStrs(strs) |
| 81 | strs = append(strs, cortexError.Message) |
| 82 | cortexError.Message = strings.Join(strs, ": ") |
| 83 | |
| 84 | return cortexError |
| 85 | } |
| 86 | |
| 87 | func Wrapf(err error, template string, params ...string) error { |
| 88 | return Wrap(err, fmt.Sprintf(template, params)) |
no test coverage detected