Skip to content

Commit 58d4b7a

Browse files
committed
resolved comment
1 parent bbaab79 commit 58d4b7a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

internal/cmd/logs/access_token/delete_all/delete_all.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
7070
req := buildRequest(ctx, model, apiClient)
7171
items, err := req.Execute()
7272
if err != nil {
73-
return fmt.Errorf("delete access token: %w", err)
73+
return fmt.Errorf("delete all access token: %w", err)
74+
}
75+
if items == nil {
76+
return fmt.Errorf("delete all access token: nil result")
7477
}
7578

7679
params.Printer.Outputf("Deleted %d access token(s)\n", len(utils.PtrValue(items.Tokens)))

internal/cmd/logs/access_token/delete_all_expired/delete_all_expired.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
7070
req := buildRequest(ctx, model, apiClient)
7171
items, err := req.Execute()
7272
if err != nil {
73-
return fmt.Errorf("delete access token: %w", err)
73+
return fmt.Errorf("delete all expired access token: %w", err)
74+
}
75+
if items == nil {
76+
return fmt.Errorf("delete all expired access token: nil result")
7477
}
7578

7679
params.Printer.Outputf("Deleted %d expired access token(s)\n", len(utils.PtrValue(items.Tokens)))

0 commit comments

Comments
 (0)