So here is my 2 cents in response to https://wiki.alopex.li/ElixirNitpicks:
Error Handling:
- Every language I've known has the same statement: Don't use exceptions if you can.
- That applies to Elixir as well, the preferred way to handle "expected" errors is by returning an error tuple: {:error, term}, bonus points if the term is a struct that provides more information on said error.
- Exceptions should only happen when the code enters a state it straight up can't handle (think completely corrupt state, dead connections, unexpected failures, failed assertions, etc).
- The above is where the "Let it crash" comes in, literally just that, let it crash and let your application pick up where it last (safely) left off.
- It's easier to debug if it fails outright, sometimes the best error handling is none at all (just capture success and let it crash otherwise)
State Management: