rust-lang/rfcs — pull request #204 by aturon (2014-08-18 01:48:48+00:00)
Title: RFC: error conventions and sugar

This RFC sets out a vision for refining error handling in Rust, in two
parts:

* A stronger set of conventions around `fail!` and `Result`
* Sugar to make working with `Result` highly ergonomic

In a nutshell, the proposal is to isolate uses of `fail!` to an extremely small
set of well-known methods (and assertion violations), with all other kinds of
errors going through `Result` for maximal flexibility. Since the main downside
of taking this extreme position is ergonomics, the RFC also proposes notation
for consuming `Result`s:

* Change macro invocation syntax from `macro_name!` to `@macro_name`.
* Use `foo!` for today's `foo.unwrap()`
* Use `foo?` for today's `try!(foo)`

While the two parts of this proposal reinforce each other, it's possible to
consider each of them separately.

[Rendered](https://github.com/aturon/rfcs/blob/error-conventions/active/0000-error-conventions-and-sugar.md)