-
Notifications
You must be signed in to change notification settings - Fork 115
Exceptions and errors
zah edited this page Aug 14, 2019
·
3 revisions
Must-read:
- http://joeduffyblog.com/2016/02/07/the-error-model/
- https://gist.github.com/zah/d2d729b39d95a1dfedf8183ca35043b3
[Draft]
-
We start actively discriminating between recoverable and non-recoverable errors when we discuss things.
-
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. -
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.
-
We gradually introduce the helpers from zah's proposal to turn the documented APIs into compiler-checked specifications.