3 ms·
How does this work if I use SNAFU and so does a library I call?
by q3k 6y ago
How does this work if I use SNAFU and so does a library I call?
- shepmaster 6y agoI'm not 100% sure what you mean, so I'll try to cover it broadly. Ideally the fact that you use SNAFU should not escape from your library; I encourage creating an [opaque] error in most cases. The current deliberate "leak" is that we implement a [trait] that exposes the ability to get a backtrace from a SNAFU error because the standard library has not yet stabilized backtraces. Once those are stabilized, we should be able to completely isolate and only operate through the `std::error::Error` trait. [opaque]: https://docs.rs/snafu/0.6.9/snafu/guide/opaque/index.html https://docs.rs/snafu/0.6.9/snafu/guide/opaque/index.html [trait]: https://docs.rs/snafu/0.6.9/snafu/trait.ErrorCompat.html https://docs.rs/snafu/0.6.9/snafu/trait.ErrorCompat.html