Support AsErrorSource for error sources that don't implement std::error::Error
Since starting to use SNAFU I've repeatedly run into libraries whose error types implement Debug + Display but not std::error::Error.
Two options I can think of that might make this easier to deal with for users:
- failure has a
Compatstruct which can just wrap the type, and implements Error if the underlying type implements Debug + Display. (I've been writing types like this as a workaround in my projects.) - Add implementations of AsErrorSource for
dyn Debug + Display + 'static, etc.
Hmm. This feels like it could be similar to #99, another place where AsErrorSource isn’t valid (due to ’static).
There, I proposed being able to effectively disable the Error::source method, which should also allow this case to work.
Can you see any downsides to disabling it in your cases?
I think that sounds like it could work, yes. I don't see any downsides for my particular use cases.
See also #23