mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-03 07:11:01 +00:00
Improve kubeadm apply error logging style
This commit is contained in:
@@ -75,3 +75,12 @@ func checkErr(prefix string, err error, handleErr func(string, int)) {
|
||||
handleErr(err.Error(), DefaultErrorExitCode)
|
||||
}
|
||||
}
|
||||
|
||||
// FormatErrMsg returns a human-readable string describing the slice of errors passed to the function
|
||||
func FormatErrMsg(errs []error) string {
|
||||
var errMsg string
|
||||
for _, err := range errs {
|
||||
errMsg = fmt.Sprintf("%s\t-%s\n", errMsg, err.Error())
|
||||
}
|
||||
return errMsg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user