error-chain
error-chain copied to clipboard
How to make libraries that use error-chain and error-chain-derive parametric over the feature backtrace?
I'm having a problem with dotenv which uses both error-chain and error-chain-derive:
https://github.com/slapresta/rust-dotenv/issues/65
This isn't a specific problem of dotenv, but any library that uses error-chain and error-chain-derive as a combination and still wants to provide full flexibility to let the users decide whether to enable backtraces or not.
It may be that the feature system is fundamentally ill-posed for such a problem. What do you think?
Yeah, it's a problem. See https://github.com/Arnavion/derive-error-chain/issues/11#issuecomment-277786180 for some discussion about common code path.
I don't think derive-error-chain is involved, right? It seems to me the situation is that crate A uses error-chain with the backtrace feature and does not expose a feature to turn it off, so crate B that wants to use error-chain without the backtrace feature can't do that.