mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Fix stutters
Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -20,7 +20,7 @@ import (
|
||||
func ReadPodIDFile(path string) (string, error) {
|
||||
content, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error reading pod ID file: %w", err)
|
||||
return "", fmt.Errorf("reading pod ID file: %w", err)
|
||||
}
|
||||
return strings.Split(string(content), "\n")[0], nil
|
||||
}
|
||||
@ -165,7 +165,7 @@ func parseSplitPort(hostIP, hostPort *string, ctrPort string, protocol *string)
|
||||
}
|
||||
ctrStart, ctrLen, err := parseAndValidateRange(ctrPort)
|
||||
if err != nil {
|
||||
return newPort, fmt.Errorf("error parsing container port: %w", err)
|
||||
return newPort, fmt.Errorf("parsing container port: %w", err)
|
||||
}
|
||||
newPort.ContainerPort = ctrStart
|
||||
newPort.Range = ctrLen
|
||||
@ -197,7 +197,7 @@ func parseSplitPort(hostIP, hostPort *string, ctrPort string, protocol *string)
|
||||
} else {
|
||||
hostStart, hostLen, err := parseAndValidateRange(*hostPort)
|
||||
if err != nil {
|
||||
return newPort, fmt.Errorf("error parsing host port: %w", err)
|
||||
return newPort, fmt.Errorf("parsing host port: %w", err)
|
||||
}
|
||||
if hostLen != ctrLen {
|
||||
return newPort, fmt.Errorf("host and container port ranges have different lengths: %d vs %d", hostLen, ctrLen)
|
||||
|
Reference in New Issue
Block a user