webrtc-rs/rtp

Consider not using Anyhow for errors

sindreij opened this issue · 3 comments

Hi, first thanks for creating these libraries, having a good story for webrtc in Rust will be awesome.

We are in the process of using this library (rtp) in an application, however since you are using Anyhow where the error-type does not implemnt std::error::Error, it's difficult to use in application which does not itself use Anyhow.

Anyhow is awesome, but as far as I can understand it's first and foremost meant for applications. Libraries, which is meant to be used from other libraries or application should use something like thiserror (https://crates.io/crates/thiserror).

Anyhow mentions this in their README: https://github.com/dtolnay/anyhow#comparison-to-thiserror

@sindreij, thanks for bringing this issue. @algesten expressed the same concern about Anyhow usage across webrtc-rs crates.

@algesten, can I assign this task to you? You can use RTP as a starting point to migrate Anyhow to thiserror or other solution.

I'm happy to work on this.

I'll get cracking on a PR for this on Monday.

Let's close this issue in favor of webrtc-rs/webrtc#106 – where I will track the effort across all sub-crates of the project.