Replies: 5 comments 3 replies
-
My first complaint there pretty much goes away as per @teozkr 's comment: #450 (comment):
#[derive(Debug, Snafu)
pub enum Error {
#[snafu(display("IO error"))]
Io(#[snafu(source)] std::io::Error, #[snafu(backtrace)] Backtrace)
} Wasn't aware of that, their documentation is all structs. myfailing_fn().await.context(Error::Io)? as well, or would you have to do: myfailing_fn().await.context(Io)? and have the The many small error types ideology seems great in theory, but wouldn't that force us to create a |
Beta Was this translation helpful? Give feedback.
-
After understanding their idea, it's been nice so far. One error enum per module pattern has been helpful to think about the error cases and to set clear boundaries. |
Beta Was this translation helpful? Give feedback.
-
Thank you both. Perhaps my mistake is to optimise for small stuff and finding snafu marginally worse for the small module cases, rather than thinking sufficiently about the large library cases like kube, where it probably would be better. If both of you are happy with it, then I think we should probably just unify around snafu. Having a consistent interface is the bigger issue to me, but it also sounds like snafu can make things better. |
Beta Was this translation helpful? Give feedback.
-
Some relatively complex crates using
|
Beta Was this translation helpful? Give feedback.
-
Some relatively complex crates using
|
Beta Was this translation helpful? Give feedback.
-
Background:
kube
usesthiserror
andkube-runtime
usessnafu
.Beta Was this translation helpful? Give feedback.
All reactions