Skip to content

452#461

Merged
RAprogramm merged 1 commit into
mainfrom
452
Jul 5, 2026
Merged

452#461
RAprogramm merged 1 commit into
mainfrom
452

Conversation

@RAprogramm

Copy link
Copy Markdown
Owner

Closes #452

#[app_error(...)]-generated From conversions now attach the domain error as source instead of discarding it, and AppError forwards providers.

Codegen

  • Struct with message: message computed from the value, then the value moves into the source slot; without message: bare error + source
  • Enum: base error built per variant via match &value, single .with_source(value) after the match
  • Generated impl requires Self: Error + Send + Sync + 'static (satisfied by the same derive; escape hatch below)
  • New no_source flag restores the old drop-value behavior for non-Send/Sync domain types (all-or-nothing across enum variants, mixed use is a compile error)

Runtime

  • impl Error for AppError gains cfg-gated provide: forwards the attached backtrace and delegates to the stored source — request_ref/request_value now reach #[provide] data through a converted AppError on toolchains with error_generic_member_access
  • On stable, the source chain alone makes is/downcast_ref/downcast/chain/root_cause work through conversions

Tests & docs

7-test integration file (incl. chain traversal to root cause and a ProblemJson regression: source never serialized), provide-forwarding tests, updated trybuild pass cases + new no_source pass case with Rc fields, 10 new derive unit tests (expansion + parser). README conversion paragraph rewritten (was: 'the domain error is dropped'), derive docs, wiki pages in three languages updated. Full workspace suite, doctests (176), no_std build, clippy zero warnings (all targets), nightly fmt, readme_sync, benches — all green after rebase over #447/#445.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.25373% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
masterror-derive/src/app_error_impl.rs 98.91% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@RAprogramm RAprogramm merged commit 337dbdf into main Jul 5, 2026
31 checks passed
@RAprogramm RAprogramm deleted the 452 branch July 5, 2026 07:45
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.

#[app_error] From conversion drops source and telemetry

1 participant