Chapter 7. Errors and Exceptions

There’s no right place for a chapter such as this one. So far, you’ve seen plenty of errors but not much about the mechanisms for handling them. That’s a bit because Erlang has two main paradigms: functional and concurrent. The functional subset is the one I’ve been explaining since the beginning of the book: referential transparency, recursion, higher-order functions, and so on. The concurrent subset is the one that makes Erlang famous: actors, thousands and thousands of concurrent processes, supervision trees, and more.

Although Erlang includes a few ways to handle errors in functional code, most of the time you’ll be told to just let it crash. The error-handling mechanisms are in the concurrent part of the language. ...

Get Learn You Some Erlang for Great Good! now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.