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

Switch from anyhow::error to thiserror or similar. #382

Open
jakibaki opened this issue Jun 21, 2024 · 1 comment
Open

Switch from anyhow::error to thiserror or similar. #382

jakibaki opened this issue Jun 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jakibaki
Copy link
Contributor

Is your feature request related to a problem? Please describe.
anyhow:error as a "catch-all" error type is not ideal as it means throwing away the benefit gained from rusts native error handling and type system which enable great error quality with little added boilerplate code.

Describe the solution you'd like
https://docs.rs/thiserror/latest/thiserror/ < is my personal choice of crates for this purpose however there are others.

Describe alternatives you've considered
There is the alternative of manually building the error types and not using any crate at all but I don't see much of a reason for that.

There might be some other crates better suited for this specific job but I am not aware of any.

@jakibaki jakibaki added the enhancement New feature or request label Jun 21, 2024
@holtgrewe
Copy link
Contributor

Also see https://github.com/dtolnay/anyhow?tab=readme-ov-file#comparison-to-thiserror

I'd say we need to split off "library"-ish code in mehari and annonars and use this error there first. This will probably come with some structural changes in these repositories, conversion into workspaces/split into smaller crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants