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

bigerror 0.9.x #17

Merged
merged 8 commits into from
Oct 15, 2024
Merged

bigerror 0.9.x #17

merged 8 commits into from
Oct 15, 2024

Conversation

mkatychev
Copy link
Contributor

@mkatychev mkatychev commented Oct 15, 2024

  • Renamed Reportable to ThinContext, the ZST value is now an associated type:

    pub trait ThinContext
    where
    Self: Sized + Context,
    {
    const VALUE: Self;

  • Added bigerror-derive to allow deriving ThinContext:

    #[derive(ThinContext)]
    #[bigerror(crate)]
    pub struct AssertionError;

    Note: #[bigerror(crate)] is only needed inside the bigerror crate, normal impls will use it like so:

    #[derive(ThinContext)]
    pub struct MyError;
  • Renamed ThinContext::with_* to use ThinContext::attach_*: cda942e

  • Removed old reportable, from_report, and to_report macros

@mkatychev mkatychev self-assigned this Oct 15, 2024
@mkatychev mkatychev marked this pull request as ready for review October 15, 2024 16:57
Copy link

@jkleinknox jkleinknox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much more ergonomic. I like it. What do you think of the name ErrorContext instead of ThinContext?

@mkatychev
Copy link
Contributor Author

@jkleinknox Context already implements Error: https://docs.rs/error-stack/latest/error_stack/trait.Context.html

the prefix here (whether thin or some other adjective) should denote a subset of Context whose value is known at compile time.

@mkatychev mkatychev merged commit d5bffbf into main Oct 15, 2024
2 checks passed
@mergify mergify bot deleted the 0.9.x branch October 15, 2024 20:00
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.

2 participants