Currently miniaudio::Error doesn't implement std::error::Error.
This makes it hard to work with crates like anyhow and its fork eyre. Instead of a single question mark operator that bubbles up the error I need to either use expect which only works the same inside main, find the right combination of map_err and eyre!/anyhow! (which is verbose and not very DRY) or manually handle errors with if let/match + return which is arguably worse.
Is there any particular reason for this? If not I think I could try whipping up a PR sometime soon, potentially using thiserror if it works well with the integer-based error representation miniaudio uses.
No. It's an oversight on my part for sure. The miniaudio API is looking like it's stabilizing so it's probably time to start making changes again, though.
Currently
miniaudio::Error
doesn't implementstd::error::Error
.This makes it hard to work with crates like anyhow and its fork eyre. Instead of a single question mark operator that bubbles up the error I need to either use
expect
which only works the same insidemain
, find the right combination ofmap_err
andeyre!
/anyhow!
(which is verbose and not very DRY) or manually handle errors withif let
/match
+return
which is arguably worse.Is there any particular reason for this? If not I think I could try whipping up a PR sometime soon, potentially using thiserror if it works well with the integer-based error representation miniaudio uses.