These are chat archives for rust-lang/rust

24th
Nov 2017
Sander Maijers
@sanmai-NL
Nov 24 2017 11:37
Very interesting how error-chain was promoted before, and now suddenly it's madness and we should use failure. I'm not convinced failure will be the last error handling story in Rust.
Steve Klabnik
@steveklabnik
Nov 24 2017 13:02
this just happens
over time you learn things
error-chain was good for its time
Michal 'vorner' Vaner
@vorner
Nov 24 2017 13:04
failure feels easier to use. If you're the main binary and really don't care about the specific error and just log it. I'm still not convinced it is a good tool when you want to handle different errors differently ‒ creating a file if it doesn't exist, wiping a cache when out of space, and giving up if you get read failure.
Sander Maijers
@sanmai-NL
Nov 24 2017 15:23
And failure does not handle localization too well, does it?
Thing is, for me the shortcomings of error-chain were clear from the get go, esp. the heavy use of macros. Those weren't lessons one could only learn from experience. Now failure is released by another team member of Rust, but I haven't noticed a broad consultation on its design. Perhaps I've missed it, but perhaps that says enough, since I happen to enjoy following Rust developments every day.
Perhaps failure represents an evolution. It seems to me it does. But it is a lot to ask developers to rewrite error handling code all over (maybe not necessarily, but ideally yes).
Aleksey Kladov
@matklad
Nov 24 2017 15:30
failure is 0.1.0, so it is exactly in the phase of gathering feedback for initial design. This evolution path is pretty similar to that of the futures crate, for example.
Sander Maijers
@sanmai-NL
Nov 24 2017 15:30
That is the technical truth, but not the PR truth. The last part bugs me bit.
Aleksey Kladov
@matklad
Nov 24 2017 15:31
Yeah, the core problem here is actually that ::std::error::Error has broken design, and that's kinda tough to fix.
error_chain represented a stop-gap solution
Sander Maijers
@sanmai-NL
Nov 24 2017 15:35
Sure, and failure is better than plain Error
Aleksey Kladov
@matklad
Nov 24 2017 15:35

failure in my opinion aims to be the long term solution/the new std error, but we'll need to see, as a community, how well it works in practice. The migration will be painful though, but it's not obvious how to avoid it :(

About consensus, yeah, there weren't any RFC yet, but it's a crates.io crate, so it is much easier to experiment with without RFCs

Sander Maijers
@sanmai-NL
Nov 24 2017 15:36
but isn't it very contentious to suggest it is set to replace current standard library code? Seems like a shortcut was taken, and this can cause more backlash than just going through all the discussion beforehand
does anyone know a chat channel where questions on Clippy can be asked? I couldn't find one
Aleksey Kladov
@matklad
Nov 24 2017 15:40

Hm, I didn't get the impression (from the presentation by @withoutboats) that failure is necessary set to replace the standard library Error... Only time an experience will tell :) But it has pretty good chances though: the design seem really solid

For clippy, there's dev-tools IRC I guess: https://kiwiirc.com/client/irc.mozilla.org/#rust-dev-tools

Sander Maijers
@sanmai-NL
Nov 24 2017 16:01
thanks
Steve Klabnik
@steveklabnik
Nov 24 2017 16:11
yeah, i think everyone has been pretty clear that it's only destined for std if everyone loves it
it can't be put into std without going through the RFC process
and boats has been very vocal about getting feedback, as was said above, that's the stage we're in right now
and i18n has an issue open
Judson Lester
@nyarly
Nov 24 2017 19:42
Re chain-error and failure - I'm running afoul of SharedError in futures; afaict, SharedError isn't Sync, which seems to make it hard to use in both cases.
Skimming the docs for failure, it looks like it's the "derived error-chain" we were promised...?
Judson Lester
@nyarly
Nov 24 2017 21:20
--pretty expanded is only available in nightly? ferreal?