Wrap takes a slice of errors and returns a single error that encapsulates those underlying errors. If the slice is nil or empty it returns nil. If the slice only contains a single element, that error is returned directly. When more than one error is wrapped, the Error() string is a concatenation of
(errs ...error)
| 26 | // When more than one error is wrapped, the Error() string is a concatenation |
| 27 | // of the Error() values of all underlying errors. |
| 28 | func Wrap(errs ...error) error { |
| 29 | return multiError(errs).flatten() |
| 30 | } |
| 31 | |
| 32 | // WrapWithSeparator same as Wrap but uses a custom separator when joining |
| 33 | // error messages. |
no test coverage detected