migrate controller to core/errors TangoError#173
Open
justinwon777 wants to merge 3 commits into
Open
Conversation
522bb2a to
1b8149a
Compare
1b8149a to
57dcd8d
Compare
3cb087d to
07400ac
Compare
57dcd8d to
9844525
Compare
07400ac to
4af25b1
Compare
4af25b1 to
e75b330
Compare
9844525 to
49e0fa3
Compare
e75b330 to
9f4720b
Compare
49e0fa3 to
b03d6d8
Compare
a30bd54 to
1a48b38
Compare
4149fe6 to
331adab
Compare
No functional changes; goimports reorders tangopb/tango.pb.go's import grouping. gazelle and gofmt reported nothing to change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
6ef5b89 to
09379b9
Compare
09379b9 to
97b10da
Compare
yushan8
reviewed
Jul 16, 2026
yushan8
reviewed
Jul 16, 2026
yushan8
reviewed
Jul 16, 2026
Add a mapper package to convert core/errors.TangoError into the proto TangoError message returned by RPCs.
97b10da to
1e2add4
Compare
yushan8
reviewed
Jul 16, 2026
| require.True(t, errors.As(err, &ce)) | ||
| assert.Equal(t, common.FailureReasonCancelled, ce.Reason()) | ||
| assert.Equal(t, common.ErrorTypeUser, ce.Type()) | ||
| assert.Contains(t, err.Error(), "context canceled") |
Contributor
There was a problem hiding this comment.
Nit: don't assert on error string
yushan8
reviewed
Jul 16, 2026
| if err != nil { | ||
| if ctx.Err() != nil { | ||
| return nil, common.WithReason(common.FailureReasonCancelled, common.ErrorTypeUser, ctx.Err()) | ||
| return nil, ctx.Err() |
Contributor
There was a problem hiding this comment.
Should we wrap the context cancelled errors too so we know where it came from?
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.
This removes all usages of core/common errors in controller and classifies user failures with TangoError.
GetChangedTargetsandGetTargetGraphreturn error withmapper.ToProtoError(retErr)so all errors are classified.Test Plan
unit tests