varfish-org / varfish-server-worker

Rust-based background worker for varfish-server
MIT License
2 stars 1 forks source link

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

Open jakibaki opened 1 month ago

jakibaki commented 1 month ago

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.

holtgrewe commented 1 month ago

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.