refactor(error): standardize aggregated error handling with multierr#129
Open
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Open
refactor(error): standardize aggregated error handling with multierr#129kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Conversation
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement Description
Standardize aggregated error handling with
go.uber.org/multierrwhile preserving Go error-chain semantics.Summary
This PR replaces custom multi-error aggregation in Docker orchestration with
multierr.Appendand aligns wrapping semantics for better diagnostics.Previously, custom aggregation reduced consistency:
errors.Is/As) was weaker across aggregated failuresNow error aggregation follows one standard pattern with explicit tests.
What Changed
1) Replaced custom aggregation with multierr
Updated:
internal/infrastructure/docker/orchestrator.goChanges:
multierr.Append2) Standardized wrapping at failure boundaries
%w3) Added usage guidance
Added:
docs/error-handling.mdGuidance covers:
%wwrapping conventionsmultierraggregation patternerrors.Is/Asbehavior4) Tests
Added/updated tests:
internal/infrastructure/docker/orchestrator_test.goWhy This Is Needed
This is a correctness and maintainability refactor.
Standardized error chains improve debugging, observability, and tooling compatibility.
Behavior Notes / Regression Impact
No intentional user-facing behavior change.
Error surfaces are more consistent while preserving root causes.
Validation Performed
go test ./internal/infrastructure/docker -count=1go test ./...golangci-lint run ./internal/infrastructure/docker/...