rust-lang/rfcs — pull request #236 by aturon (2014-09-11 23:11:45+00:00)
Title: RFC: Error conventions, take 3

This is a *conventions* RFC for formalizing the basic conventions around error handling in Rust libraries.

The high-level overview is:

* For *catastrophic errors*, abort the process or fail the task depending on whether any recovery is possible.

* For *contract violations*, fail the task. (Recover from programmer errors at a coarse grain.)

* For *obstructions to the operation*, use `Result` (or, less often, `Option`). (Recover from obstructions at a fine grain.)

* Prefer liberal function contracts, especially if reporting errors in input values may be useful to a function's caller.

This RFC follows up on [two](https://github.com/rust-lang/rfcs/pull/204) [earlier](https://github.com/rust-lang/rfcs/pull/220) attempts by giving more leeway in when to fail the task.

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