catch, exit, and throw
Learn how to raise errors with the help of catch, exit, and throw.
We'll cover the following
Elixir code and the underlying Erlang libraries can raise the second kind of error. These are generated when a process calls error
, exit
, or throw
. All three take a parameter, which is available to the catch handler.
Example
Here’s an example to describe catch
, exit
, and throw
:
Get hands-on with 1400+ tech skills courses.