diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-18 15:16:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 15:16:05 +0000 |
commit | 5c6b5ef34905f40562b518799c35be8d06694e65 (patch) | |
tree | ca34417ff972421d4956e1e3a4594b6508f2b24d /pkg/errorhandling/errorhandling.go | |
parent | a73c76df29a022a05d71c351244fe6e54504edc2 (diff) | |
parent | 641272d41107f61d996ed71b6f5905e4287dda5a (diff) | |
download | podman-5c6b5ef34905f40562b518799c35be8d06694e65.tar.gz podman-5c6b5ef34905f40562b518799c35be8d06694e65.tar.bz2 podman-5c6b5ef34905f40562b518799c35be8d06694e65.zip |
Merge pull request #8747 from vrothberg/run-950
remote copy
Diffstat (limited to 'pkg/errorhandling/errorhandling.go')
-rw-r--r-- | pkg/errorhandling/errorhandling.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/errorhandling/errorhandling.go b/pkg/errorhandling/errorhandling.go index ca6b60bc5..21df261fb 100644 --- a/pkg/errorhandling/errorhandling.go +++ b/pkg/errorhandling/errorhandling.go @@ -19,7 +19,12 @@ func JoinErrors(errs []error) error { // blank lines when printing the error. var multiE *multierror.Error multiE = multierror.Append(multiE, errs...) - return errors.New(strings.TrimSpace(multiE.ErrorOrNil().Error())) + + finalErr := multiE.ErrorOrNil() + if finalErr == nil { + return finalErr + } + return errors.New(strings.TrimSpace(finalErr.Error())) } // ErrorsToString converts the slice of errors into a slice of corresponding |