AsRefError is needed because anyhow::Error only implements AsRef<dyn Error>, not Error,
but &dyn Error does not implement AsRef<dyn Error> because AsRef doesn’t have a blanket
implementation (https://doc.rust-lang.org/std/convert/trait.AsRef.html#reflexivity).