O'Reilly logo

Learning Elixir by Kenny Ballou

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exception handling

You may be familiar with the concept of exceptions from other languages. Thus, you may be tempted to think of them similarly when coming to Elixir. However, like many things we have covered so far, and many things we will cover, we need to forget most what we have learned when learning most concepts of functional programming and Elixir.

Elixir offers some basic facilities for raising and catching exceptions.

First and foremost, exceptions in Elixir are not control flow or branching structures. Exceptions are meant strictly for exceptional behaviour, that is, things that should absolutely not happen is happening. Some examples of exceptions are database servers going down, name servers failing, or attempting to open a fixed location ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required