Understand the “Let It Crash” Philosophy
Understand how to stop a program from crashing using error handling.
We used Task.Supervisor
to isolate a process crash, but it may seem strange that we didn’t prevent the crash by simply adding error handling in the send_email/1
function. In this particular case, we did so on purpose to simulate an unexpected exception. In practice, we should provide error handling when we expect an error to occur, and leave the rest to the supervisor as a last resort.
Error handling in Elixir
When discussing error handling for Elixir, the phrase “let it crash” is often used. As a result, some people assume that “let it crash” means that Erlang and Elixir developers don’t do any error handling, which is not the ...