summaryrefslogtreecommitdiff
path: root/cmd/podman/utils/error.go
blob: 2d58bc70d93ec12240e1df4c2d7e8dd24ce023b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package utils

import (
	"fmt"
	"os"
)

type OutputErrors []error

func (o OutputErrors) PrintErrors() (lastError error) {
	if len(o) == 0 {
		return
	}
	lastError = o[len(o)-1]
	for e := 0; e < len(o)-1; e++ {
		fmt.Fprintf(os.Stderr, "Error: %s\n", o[e])
	}
	return
}