Description
WorkflowValidationError is a custom error type in pkg/compiler/compiler_filters_validation.go that does not implement Unwrap(). This prevents errors.Is and errors.As from traversing the error chain, breaking standard Go error inspection patterns.
Additionally, compiler_orchestrator_engine.go line 245 uses fmt.Errorf without %w, silently dropping the wrapped error from the chain.
Suggested Changes
- Add
Unwrap() error method to WorkflowValidationError in compiler_filters_validation.go
- Fix
fmt.Errorf call at compiler_orchestrator_engine.go:245 to use %w verb
- Verify existing tests still pass; add a test asserting
errors.Is traversal works through WorkflowValidationError
Files Affected
pkg/compiler/compiler_filters_validation.go (add Unwrap() method)
pkg/compiler/compiler_orchestrator_engine.go line 245 (add %w)
pkg/compiler/compiler_filters_validation_test.go (add error chain test)
Success Criteria
errors.Is(wrappedErr, target) correctly traverses WorkflowValidationError
- No
fmt.Errorf calls without %w in compiler_orchestrator_engine.go
- All existing tests pass
Source
Extracted from Daily Compiler Code Quality Report #45370
Priority
Medium — Broken error chains affect debugging and error handling correctness
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 205.3 AIC · ⌖ 5.26 AIC · ⊞ 7K · ◷
Description
WorkflowValidationErroris a custom error type inpkg/compiler/compiler_filters_validation.gothat does not implementUnwrap(). This preventserrors.Isanderrors.Asfrom traversing the error chain, breaking standard Go error inspection patterns.Additionally,
compiler_orchestrator_engine.goline 245 usesfmt.Errorfwithout%w, silently dropping the wrapped error from the chain.Suggested Changes
Unwrap() errormethod toWorkflowValidationErrorincompiler_filters_validation.gofmt.Errorfcall atcompiler_orchestrator_engine.go:245to use%wverberrors.Istraversal works throughWorkflowValidationErrorFiles Affected
pkg/compiler/compiler_filters_validation.go(addUnwrap()method)pkg/compiler/compiler_orchestrator_engine.goline 245 (add%w)pkg/compiler/compiler_filters_validation_test.go(add error chain test)Success Criteria
errors.Is(wrappedErr, target)correctly traversesWorkflowValidationErrorfmt.Errorfcalls without%win compiler_orchestrator_engine.goSource
Extracted from Daily Compiler Code Quality Report #45370
Priority
Medium — Broken error chains affect debugging and error handling correctness