summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-11-17 07:02:11 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-11-17 09:19:22 -0500
commit389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb (patch)
treef3970765fe109233dd441da8a7c5b3b5da3e945e /cmd/podman/common
parent7d067afac716927b26c452d4d75478b9f13abd62 (diff)
downloadpodman-389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb.tar.gz
podman-389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb.tar.bz2
podman-389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb.zip
Remove some more excessive wrapping and stuttering
Stop over wrapping API Calls The API calls will return an appropriate error, and this wrapping just makes the error message look like it is stuttering and a big mess. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/specgen.go8
-rw-r--r--cmd/podman/common/util.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 39ff02857..0bb6e79e5 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -592,7 +592,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
case "max-size":
logSize, err := units.FromHumanSize(split[1])
if err != nil {
- return errors.Wrapf(err, "%s is not a valid option", o)
+ return err
}
s.LogConfiguration.Size = logSize
default:
@@ -662,7 +662,7 @@ func makeHealthCheckFromCli(inCmd, interval string, retries uint, timeout, start
}
intervalDuration, err := time.ParseDuration(interval)
if err != nil {
- return nil, errors.Wrapf(err, "invalid healthcheck-interval %s ", interval)
+ return nil, errors.Wrapf(err, "invalid healthcheck-interval")
}
hc.Interval = intervalDuration
@@ -673,7 +673,7 @@ func makeHealthCheckFromCli(inCmd, interval string, retries uint, timeout, start
hc.Retries = int(retries)
timeoutDuration, err := time.ParseDuration(timeout)
if err != nil {
- return nil, errors.Wrapf(err, "invalid healthcheck-timeout %s", timeout)
+ return nil, errors.Wrapf(err, "invalid healthcheck-timeout")
}
if timeoutDuration < time.Duration(1) {
return nil, errors.New("healthcheck-timeout must be at least 1 second")
@@ -682,7 +682,7 @@ func makeHealthCheckFromCli(inCmd, interval string, retries uint, timeout, start
startPeriodDuration, err := time.ParseDuration(startPeriod)
if err != nil {
- return nil, errors.Wrapf(err, "invalid healthcheck-start-period %s", startPeriod)
+ return nil, errors.Wrapf(err, "invalid healthcheck-start-period")
}
if startPeriodDuration < time.Duration(0) {
return nil, errors.New("healthcheck-start-period must be 0 seconds or greater")
diff --git a/cmd/podman/common/util.go b/cmd/podman/common/util.go
index a971aa957..ef30e08d3 100644
--- a/cmd/podman/common/util.go
+++ b/cmd/podman/common/util.go
@@ -250,7 +250,7 @@ func parseAndValidateRange(portRange string) (uint16, uint16, error) {
func parseAndValidatePort(port string) (uint16, error) {
num, err := strconv.Atoi(port)
if err != nil {
- return 0, errors.Wrapf(err, "cannot parse %q as a port number", port)
+ return 0, errors.Wrapf(err, "invalid port number")
}
if num < 1 || num > 65535 {
return 0, errors.Errorf("port numbers must be between 1 and 65535 (inclusive), got %d", num)