Skip to content

Commit b4cbd6c

Browse files
committed
Fix warnings output
1 parent be96fff commit b4cbd6c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cli/root.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,11 @@ func checkWarnings(cmd *cobra.Command, client *codersdk.Client) error {
549549
defer cancel()
550550

551551
entitlements, err := client.Entitlements(ctx)
552-
if err != nil {
553-
return xerrors.Errorf("get entitlements to show warnings: %w", err)
554-
}
555-
for _, w := range entitlements.Warnings {
556-
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), cliui.Styles.Warn.Render(w))
552+
if err == nil {
553+
for _, w := range entitlements.Warnings {
554+
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), cliui.Styles.Warn.Render(w))
555+
}
557556
}
558-
559557
return nil
560558
}
561559

0 commit comments

Comments
 (0)