Error handling can be tricky, and can cause a task you would expect to take a single day to instead take a whole week!
1/10
This episode is focused on dealing with errors caused by working with external services. Anytime you're dealing with external dependency, you expose yourself to risk.
2/10
You risk that the service might be down. You risk that the service may change. The number of potential errors is grand and unknowable.
3/10
So how do you handle the specific errors you care about while also dealing with errors you don't care about specifically?
4/10
It starts with observability and monitoring. Monitoring which errors occur in your production application lets you know when your users encounter bugs in real-time and when you aren't handling a specific error gracefully.
5/10
To deal with errors called by making requests to an external service, consider isolating the entire API call in its own process that can handle raising the error. This links the lifecycle of the web request (your LiveView) and the lifecycle of the external API call.
6/10
Upon raising an exception in the process, you can have another process acting as a supervisor to monitor the crash of the original process. This is your "work coordinator" who can handle tracking how often a process is failing (halting it if needed)
7/10
The benefit of this approach is that you isolate errors to allow them to blow up safely, but you can also specifically handle errors you care about. You take a holistic approach to writing errors which leads to less code dedicated to error handling.
8/10
This leads to easier-to-use APIs for your end-user. They don't have to write code to handle a plethora of errors either.
9/10
Hope you enjoyed today's summary! I do not represent @ElixirOutlaws - I just summarize information for fun and to learn.
Raspberry pi is a great way to get your start in IoT, and Nerves and Livebook take that even further. Cool enough: the first real Elixir code Lars wrote was for the Rasberry Pi Zero.
1/13
You can sandwich a Rasberry Pi and an eInk display together. The Rasberry Pi runs your application and your application can use The Libraries Inky and Chisel to write to the display.
Bottom line, before the end of September, if you are on Elixir OTP 23 or 24 you should upgrade to the latest patch.
specifically OTP 23.3.4.5 or OTP 24.0.4
If you are on an OTP version older than 23, the good news is you will be unaffected so long as you do not upgrade your dependencies. You can freeze your dependencies in order to buy yourself time to upgrade to OTP 23 or 24.
By far the most loved library on the Panel today was Telemetry. Telemetry powers monitoring and observability in elixir projects and provides a consistent interface to do so. Other mentions were OTP, Livebook, and site_encrypt.
1/24
When members of today's panel came into the Elixir Industry, they found opinions they like and trust from the Elixir community but also questioned established norms. Thus today's topic: Code Heresy.