Skip to content

Commit 7246460

Browse files
fix(contacts): include resource name in delete failure error
Helps users recover if delete step fails after successful copy. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d016630 commit 7246460

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

internal/cmd/contacts_crud_error_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func TestContactsOtherDelete_DeleteFailure(t *testing.T) {
325325
if err == nil {
326326
t.Fatal("expected error, got nil")
327327
}
328-
if !strings.Contains(err.Error(), "delete copied contact:") {
329-
t.Fatalf("expected error to contain 'delete copied contact:', got: %v", err)
328+
if !strings.Contains(err.Error(), "delete copied contact") {
329+
t.Fatalf("expected error to contain 'delete copied contact', got: %v", err)
330330
}
331331
}

internal/cmd/contacts_directory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func (c *ContactsOtherDeleteCmd) Run(ctx context.Context, flags *RootFlags) erro
365365
return err
366366
}
367367
if _, err := contactsSvc.People.DeleteContact(copied.ResourceName).Do(); err != nil {
368-
return fmt.Errorf("delete copied contact: %w", err)
368+
return fmt.Errorf("delete copied contact %s: %w", copied.ResourceName, err)
369369
}
370370

371371
if outfmt.IsJSON(ctx) {

0 commit comments

Comments
 (0)