Skip to content

Commit bb3571b

Browse files
committed
Fix cli errors
1 parent 0ecbb79 commit bb3571b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cli/templateversionarchive.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ func (r *RootCmd) archiveTemplateVersion() *clibase.Cmd {
7979

8080
err := client.SetArchiveTemplateVersion(ctx, version.ID, !unarchive.Value())
8181
if err != nil {
82-
failed++
83-
_, _ = fmt.Fprintln(inv.Stderr, fmt.Sprintf("Failed to archive template version %q: %s", version.Name,
84-
pretty.Sprint(cliui.DefaultStyles.Error, err.Error())))
85-
continue
82+
return xerrors.Errorf("set template version %q: %w", version.Name, err)
8683
}
8784

8885
_, _ = fmt.Fprintln(
@@ -164,10 +161,7 @@ func (r *RootCmd) archiveTemplateVersions() *clibase.Cmd {
164161
for _, template := range templates {
165162
resp, err := client.ArchiveTemplateVersions(ctx, template.ID, all.Value())
166163
if err != nil {
167-
_, _ = fmt.Fprintln(inv.Stderr, fmt.Sprintf("Failed to archive template versions for %q: %s", template.Name,
168-
pretty.Sprint(cliui.DefaultStyles.Error, err.Error())))
169-
failed++
170-
continue
164+
return xerrors.Errorf("archive template %q: %w", template.Name, err)
171165
}
172166

173167
_, _ = fmt.Fprintln(

0 commit comments

Comments
 (0)