Skip to content

refactor: use connect error codes instead of custom Error type - #27

Merged
odsod merged 1 commit into
mainfrom
connect-errors
May 18, 2026
Merged

odsod merged 1 commit into
mainfrom
connect-errors

Conversation

@odsod

@odsod odsod commented May 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Wrap Error in connect.NewError() via connectError() method (preserves errors.As for rate-limit info)
  • Add HTTP-level client_test.go with httptest.NewServer coverage
  • Tests verify all 3 methods, error code mapping, and rate-limit header preservation

Motivation

Aligns with SDK conformance standard: consumers get standard Connect error codes while retaining access to rich error details (rate-limit reset duration) via errors.As.

Test plan

  • go build ./... passes
  • go test ./... passes
  • errors.As(err, &rfms.Error{}) still works through connect wrapper
  • Rate-limit Retry-After header preserved in unwrapped error

@odsod
odsod force-pushed the connect-errors branch from 0cfd1f6 to 85502e1 Compare May 18, 2026 07:16
- Wrap Error in connect.NewError() via connectError() method (preserves errors.As for rate-limit info)
- Add HTTP-level client_test.go with httptest.NewServer coverage
- Tests verify all 3 methods, error code mapping, and rate-limit header preservation
@odsod
odsod force-pushed the connect-errors branch from 85502e1 to 17ff297 Compare May 18, 2026 07:20
@odsod
odsod merged commit f58673e into main May 18, 2026
1 check passed
@odsod
odsod deleted the connect-errors branch May 18, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant