Skip to content

[WIP] refactor: migrate controller and orchestrator to core/errors TangoError#173

Draft
justinwon777 wants to merge 1 commit into
justin.won/errorsfrom
common-migrate
Draft

[WIP] refactor: migrate controller and orchestrator to core/errors TangoError#173
justinwon777 wants to merge 1 commit into
justin.won/errorsfrom
common-migrate

Conversation

@justinwon777

@justinwon777 justinwon777 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Migrate controller and orchestrator from common.ClassifiedError / common.WithReason to core/errors.TangoError

  • controller/errors.go: Replaced emitFailureMetric to use tangoerrors.GetErrorCode / GetFailureSource instead of ClassifiedError. Removed failureReason* constants. Added newControllerInfraError and newControllerUserError helpers.
  • controller/gettargetgraph.go and controller/getchangedtargets.go:
  • RPC deferred blocks now call mapper.ToProtoError(retErr) to convert errors to YARPC responses with TangoError details.
  • Validation errors wrapped with newControllerUserError.
  • Controller-originated infra errors (send, compare) wrapped with newControllerInfraError.
  • Subsystem errors (storage, orchestrator) pass through — classification comes from the subsystem.
  • Removed manual ctx.Err() checks — GetErrorCode and the mapper handle context.Canceled automatically.
  • core/common/errors.go: Deleted

Test Plan

unit tests

Replace common.ClassifiedError / common.WithReason with core/errors
TangoError throughout the controller and orchestrator. RPC methods now
convert errors via mapper.ToProtoError in their deferred block, and
emitFailureMetric uses GetErrorCode / GetFailureSource to tag metrics.

Deletes core/common/errors.go — ClassifiedError, WithReason, and all
failure reason constants are no longer used.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@justinwon777 justinwon777 requested review from a team as code owners July 10, 2026 08:46
@justinwon777 justinwon777 marked this pull request as draft July 10, 2026 08:49
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