rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Replace `anyhow` with `thiserror` in libraries

Open emilk opened this issue 2 years ago • 2 comments

We have been too liberal of our use of anyhow. For any pub function in our libraries, we should be using thiserror instead of anyhow, to get more type safety and explicitness of what can go wrong.

Internal use of anyhow in a crate is less bad, but would also be good to change to thiserror.

anyhow should mostly be used in high-level crates (binaries) to easily summarize errors coming from many different places without having to create too many error enums

emilk avatar Apr 14 '23 06:04 emilk

We should do this in re_types in particular, and somehow forbid it so that it doesn't come back.

emilk avatar Jul 14 '24 15:07 emilk

I have replaced it in re_types and am doing a proper verification that it works before making a draft pull request. Do we want to include all of the other crates in a single pull request or would you prefer doing this with re_types and scoping it later to include other crates? Based on previous merged pull requests I can put together one for re_types @emilk

Edit: check https://github.com/rerun-io/rerun/pull/9579

ishakbhatt avatar Apr 10 '25 15:04 ishakbhatt