I know not everyone is into "failure", but I think it's fantastic! Backtraces. Explanations. Blanket wrappers for all error types. I like how it allows non-experts to create a good error handling story in Rust :D https://boats.gitlab.io/failure/fail.html …
-
Show this thread
-
The only thing I still have trouble with is how to create custom Error enums. It seems like a lot of typing, which isn't great. Wish creating enums over enums over enums would be easier. Pretty sure there's a way to make that possible though! :D
1 reply 0 retweets 2 likesShow this thread -
Oh actually, I guess all we need is a single macro to match (inner) Error enums + (outer) Error structs and we should be good! Okay; excited that this is possible! Probably the other thing that would be brilliant would be a way to match these back to `ensure!()` statements.
1 reply 0 retweets 1 likeShow this thread
Oh, don't think I've talked about `ensure!()` at all. It's the Result equivalent of `assert!()`. So if you think of assert as "panic if this conditional is false", you can think of ensure as "return an Error if this conditional is false". One line error handling is great!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.