Skip to content

fix: aggregate nuke errors and propagate context#1045

Open
james00012 wants to merge 3 commits intomasterfrom
jk/nuke-error-aggregation
Open

fix: aggregate nuke errors and propagate context#1045
james00012 wants to merge 3 commits intomasterfrom
jk/nuke-error-aggregation

Conversation

@james00012
Copy link
Contributor

@james00012 james00012 commented Mar 8, 2026

Summary

  • Error aggregation: NukeAllResources and nukeAllResourcesInRegion now collect per-region nuke errors via hashicorp/go-multierror and return them to the caller, instead of silently discarding them.
  • Context propagation: Threads context.Context from the CLI layer through NukeAllResourcesnukeAllResourcesInRegion → individual Nuke calls, replacing the previous context.TODO().
  • Broader throttle detection: Rate-limit retry now also matches ThrottlingException and TooManyRequestsException in addition to RequestLimitExceeded.

Test plan

  • go build ./... and go vet ./... pass
  • Verify existing unit/integration tests pass
  • Manual run against a sandbox account to confirm errors surface correctly

Previously NukeAllResources silently discarded per-region errors.
Now errors are aggregated via multierror and returned to the caller.
Also threads context through to individual Nuke calls and broadens
throttle detection to cover ThrottlingException and TooManyRequestsException.
@james00012 james00012 requested a review from denis256 as a code owner March 8, 2026 18:03
…atching

Replace fragile strings.Contains() throttling checks with structured
error code matching via the new util.IsThrottlingError() helper,
consistent with the existing pattern in util/error.go.
@james00012 james00012 force-pushed the jk/nuke-error-aggregation branch from e755459 to c6a6a74 Compare March 10, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant