Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking caller on DataError construction #4048

Open
robertbastian opened this issue Sep 18, 2023 · 1 comment
Open

Tracking caller on DataError construction #4048

robertbastian opened this issue Sep 18, 2023 · 1 comment
Labels
blocked A dependency must be resolved before this is actionable C-data-infra Component: provider, datagen, fallback, adapters good first issue Good for newcomers

Comments

@robertbastian
Copy link
Member

It would be very useful to store a core::panic::Location inside the DataError. Currently panicking is much more ergonomic than using DataError, because with DataError you only get the location where the error is unwrapped and have to chase down the error message, which often is not a pure literal.

This is currently blocked on rust-lang/rust#76156, as our error constructors are const and core::panic::Location::caller() is not yet.

@robertbastian robertbastian added good first issue Good for newcomers C-data-infra Component: provider, datagen, fallback, adapters blocked A dependency must be resolved before this is actionable labels Sep 18, 2023
@sffc
Copy link
Member

sffc commented Sep 19, 2023

Losing the caller location when bubbling up errors is I think a known issue with the Rust error propagation model, not specific to DataError. CC @yaahc, thoughts on the recommended pattern here for library code?

@sffc sffc added this to the Backlog ⟨P4⟩ milestone Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked A dependency must be resolved before this is actionable C-data-infra Component: provider, datagen, fallback, adapters good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants