Original discussion on discord, and further issue raised here: appr-tc/rtp#14
Anyhow is great, but maybe not a good fit for webrtc.rs. To summarize:
- Anyhow is mostly meant for applications, not libraries.
- Anyhow doesn't implement
std::error::Error (it can't), which makes it hard to interoperate in apps that rely on that.
- Not having explicit enumerations of possible errors means the webrtc.rs API effectively have "hidden" code paths. It's not possible for a user to know which errors could potentially be thrown from an API call returning
anyhow::Result<X>
Way forward
- Replace anyhow with idiomatic Rust error enums.
- Keep
thiserror to help implement said enums.
- Maintain ergonomics for
? use internally in webrtc.rs (work with From traits and rewrap errors).
- Bring out possible errors in API calls. Either via types or documentation.
This issue will be used to coordinate the effort which will span all the sub-crates.
Original discussion on discord, and further issue raised here: appr-tc/rtp#14
Anyhow is great, but maybe not a good fit for webrtc.rs. To summarize:
std::error::Error(it can't), which makes it hard to interoperate in apps that rely on that.anyhow::Result<X>Way forward
thiserrorto help implement said enums.?use internally in webrtc.rs (work with From traits and rewrap errors).This issue will be used to coordinate the effort which will span all the sub-crates.