Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit e76e668

Browse files
committed
Tidy registry errors
Signed-off-by: Christopher Crone <[email protected]>
1 parent ac5e896 commit e76e668

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packager/registry.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ func Load(repotag string) error {
5252
cmd := exec.Command("docker", "save", "-o", file, repotag)
5353
output, err := cmd.CombinedOutput()
5454
if err != nil {
55-
fmt.Println("Error from docker save command:")
56-
fmt.Println(string(output))
57-
return err
55+
return errors.Wrapf(err, "error from docker save command: %s", string(output))
5856
}
5957
defer os.Remove(file)
6058
f, err := os.Open(file)
@@ -93,18 +91,17 @@ func Push(appname, prefix, tag string) error {
9391
cmd := exec.Command("docker", "push", prefix+appName(appname)+constants.AppExtension+":"+tag)
9492
output, err := cmd.CombinedOutput()
9593
if err != nil {
96-
fmt.Println(string(output))
94+
return errors.Wrapf(err, "error from docker push command: %s", string(output))
9795
}
98-
return err
96+
return nil
9997
}
10098

10199
// Pull pulls an app from a registry
102100
func Pull(repotag string) error {
103101
cmd := exec.Command("docker", "pull", repotag)
104102
output, err := cmd.CombinedOutput()
105103
if err != nil {
106-
fmt.Println(string(output))
107-
return err
104+
return errors.Wrapf(err, "error from docker pull command: %s", string(output))
108105
}
109106
return Load(repotag)
110107
}

0 commit comments

Comments
 (0)