Search⌘ K

Understand the “Let It Crash” Philosophy

Understand Elixir’s let it crash philosophy and how it shapes error handling and supervision in concurrent programming. Learn why supervisors restart processes and how this approach differs from defensive programming, helping you build resilient Elixir applications.

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 ...