Jake Goulding

Results 615 comments of Jake Goulding

> I thought maybe I could have one Error variant `DeserializeJson`, but that seems impossible right now because of the different source Error types @Ploppz there have been mentions in...

The issue here is that `#[snafu(source(from(...)))]` is in the wrong location; it needs to be on the `source` field: ### Incorrect ```rust #[derive(Debug, Snafu)] enum Error { #[snafu(source(from(rumqtt::ConnectError, TextError::from)))] #[snafu(display("Failed...

Opinion wise, this is an aspect of failure that I dislike — the fact that an error is implemented with failure "leaks out" in the public API of the crate,...

Yeah, `build` is relatively new. It is indirectly demonstrated in https://docs.rs/snafu/0.6.9/snafu/guide/examples/basic/index.html Out of curiosity, how are you using `build`? It's needed in some cases, but not in many others.

If I understand what you want, I'd probably end up with ```rust #[derive(Debug, Snafu)] pub enum Error { #[snafu(display("Parse Error on {field}: {source}"))] ParseError { field: String, source: InnerParseError, },...

Generally, I'm amenable to addressing the stated goal. I think there's some details to be ironed out. For example, what _exactly_ would an ideal `main` function look like? Here's some...

> Maybe you don't need two distinct types and you can implement Debug for Exit as well? Please try it and let me know how it works. I wasn’t able...

This will likely be fixed by #355

I've [force-pushed some changes](https://github.com/shepmaster/snafu/compare/a05a7f958a29cb47e248470c0acdc73157487f75..6030ec9646064661fa399f98df860ba129290ea5) as the crate already has an alias for `Error`: https://github.com/shepmaster/snafu/blob/b552522ca92031a4450c914dce114013af383b7c/src/lib.rs#L324-L332 Can you double-check that this still works for your original case?

I've rebased on `main` after taking care of some tangentially-related CI failures.