mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
fix multierror merge
This commit is contained in:
@@ -18,10 +18,6 @@ import (
|
||||
// MergeMultierrorWarnings takes job warnings and canonicalize warnings and
|
||||
// merges them into a returnable string. Both the errors may be nil.
|
||||
func MergeMultierrorWarnings(warnings ...error) string {
|
||||
if len(warnings) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
var warningMsg multierror.Error
|
||||
for _, warn := range warnings {
|
||||
if warn != nil {
|
||||
@@ -29,6 +25,10 @@ func MergeMultierrorWarnings(warnings ...error) string {
|
||||
}
|
||||
}
|
||||
|
||||
if len(warningMsg.Errors) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Set the formatter
|
||||
warningMsg.ErrorFormat = warningsFormatter
|
||||
return warningMsg.Error()
|
||||
|
||||
Reference in New Issue
Block a user