concept try in category elixir

appears as: tries, try, try
Elixir in Action

This is an excerpt from Manning's book Elixir in Action.

The Elixir compiler treats some language constructs in a special way. Such constructs are called special forms (https://hexdocs.pm/elixir/Kernel.SpecialForms.html). Some examples include the capture syntax&(…), for comprehension (presented in chapter 3), receive construct (chapter 5), and try blocks (chapter 8).

It is, of course, possible to intercept any kind of error (error, exit, or throw) and do something about it. The main tool for this is the try expression. Here’s how to run some code and catch errors: