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

Add an Other variant to VdafError #858

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

divergentdave
Copy link
Collaborator

Closes #424. This implements the suggestion from that issue, adding an Other variant that accepts a boxed error trait object.

@divergentdave divergentdave requested a review from a team as a code owner November 30, 2023 17:33
@cjpatton
Copy link
Collaborator

Wow, this literally came up yesterday in Daphne. I'm so for it.

Copy link
Contributor

@inahga inahga left a comment

Choose a reason for hiding this comment

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

LGTM, expected usage looks good.

    #[derive(Debug, thiserror::Error)]
    pub enum InahgaError {
        #[error("inahga error")]
        Oops,
    }

    #[test]
    fn test() {
        dbg!(VdafError::Other(Box::new(InahgaError::Oops)));
    }

@divergentdave divergentdave merged commit 3ece13a into main Dec 1, 2023
6 checks passed
@divergentdave divergentdave deleted the david/vdaferror-other branch December 1, 2023 21:43
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.

Implementing a new VDAF should not require extending vdaf::VdafError
4 participants