avoid ignoring missing stack error#1835
Conversation
📝 WalkthroughWalkthroughAdds a concrete Changes
Sequence Diagram(s)(omitted — changes are localized to error type and handler and do not introduce a multi-component sequential flow requiring visualization) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter" Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pkg/stacks/manager.go`:
- Around line 228-231: Do not blanket-convert all errors from sm.GetRemote into
ErrNotExist; instead, call stack, err = sm.GetRemote(ctx, name) and if err !=
nil inspect it (using errors.Is/As against the remote-not-found sentinel/type
returned by sm.GetRemote or by checking a dedicated IsNotFound helper) and only
return &ErrNotExist{StackName: name} when the remote error explicitly indicates
the stack is missing; otherwise propagate or wrap the original err (e.g., return
nil, "", fmt.Errorf("GetRemote %s: %w", name, err)) so network/auth/fabric
errors are preserved.
Description
I tried to run
And got back an error that said
Looking more closely, it looks like we swallowed the missing stack error. This PR restores it.
Linked Issues
Checklist
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.