Skip to content

Commit

Permalink
tooling: update sweeper to be more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
DXTimer committed Oct 17, 2024
1 parent e64b705 commit 1793626
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/sweep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ func cleanupDomains(ctx context.Context, dnsimpleClient *dnsimple.Client, accoun

fmt.Printf("Deleting domain %s\n", domain.Name)
_, err := dnsimpleClient.Domains.DeleteDomain(ctx, account, domain.Name)
if err != nil {
if err != nil && strings.Contains(err.Error(), "The domain cannot be deleted because it is either being registered or is transferring in") {
fmt.Printf("Skipping domain %s because it is being registered or is transferring in\n", domain.Name)
continue
} else if err != nil {
panic(err)
}
}
Expand Down

0 comments on commit 1793626

Please sign in to comment.