Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

EnrError should implement std::error::Error #37

Open
adoerr opened this issue Jul 17, 2022 · 1 comment
Open

EnrError should implement std::error::Error #37

adoerr opened this issue Jul 17, 2022 · 1 comment

Comments

@adoerr
Copy link

adoerr commented Jul 17, 2022

EnrError currently is a plain struct.

IMO, this is a bit non-idiomatic. Especially conversion into other custom error types is more involved than it should be. For example, thiserror offers a #[from] attribute which auto-generates a From implementation. This, however, expects the source error type to implement std::error::Error.

As an alternative, we could just derive thiserror::Error which will generate a std::error::Error implementation.

WDYT?

@AgeManning
Copy link
Contributor

Sure, Don't mind implementing the std::error::Error trait. Will add it in

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants