Skip to content

Exceptions and errors

zah edited this page Aug 14, 2019 · 3 revisions

Must-read:

[Draft]

  1. We start actively discriminating between recoverable and non-recoverable errors when we discuss things.

  2. We mainly use asserts (particularly doAssert) when we are trying to detect non-recoverable errors in the code. Most APIs should be rather strict about their inputs.

  3. We bless the use of both exceptions and error codes for recoverable errors (the more appropriate is selected on a case-by-case basis). We make an active effort to document the recoverable errors of each API when we design it.

  4. We gradually introduce the helpers from zah's proposal to turn the documented APIs into compiler-checked specifications.

Clone this wiki locally