Skip to content

ergonomic refactors: forward chaining, unified code= syntax, idiomatic conversions - #17

Open
ae2rs wants to merge 11 commits into
mainfrom
ae2rs/ergonomic-refactors
Open

ergonomic refactors: forward chaining, unified code= syntax, idiomatic conversions#17
ae2rs wants to merge 11 commits into
mainfrom
ae2rs/ergonomic-refactors

Conversation

@ae2rs

@ae2rs ae2rs commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • #[aerro(forward)] + .forward() — cross-service error chaining: a variant can carry an upstream ServiceFailure<T> and transfer its frames automatically via .forward(), without manually copying frames
  • Breaking: unified code = Category::GrpcCode syntax — replaced the two-field category = …, code = … grammar with a single two-segment path; all call sites migrated
  • Idiomatic conversion traits — replaced the bespoke IntoStatus / StatusIntoResultExt extension traits with standard From<ServiceFailure<E>> for Status and TryFrom<Status> for ServiceFailure<E>
  • AerroEncode extension trait — adds .encode() (zero-arg, default opts) and .encode_with_opts(opts) directly on E: Aerro and ServiceFailure<E>; EncodeOptions only appears at public-boundary call sites
  • OTel tracing example — demonstrates that aerro captures the active span's trace_id/span_id at error creation time

Test plan

  • cargo test -p aerro — 35+ unit + integration + trybuild UI tests, all pass
  • cargo clippy -p aerro --all-targets --all-features -- -D warnings — clean
  • cargo run --example basic, --example exposure, --example trace_chain, --example tracing — all run correctly

🤖 Generated with Claude Code

@ae2rs
ae2rs force-pushed the ae2rs/ergonomic-refactors branch from 514fd76 to ea70d1f Compare May 26, 2026 15:29
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