TLDR Web Dev · ARTICLES & TUTORIALS
HOW TO REASON ABOUT EXCEPTIONS
Summary from the TLDR Web Dev newsletter
While every function has the potential to throw an exception, it's more helpful to think about whether the entire function succeeds or fails rather than focusing on individual operations that could cause errors. Make functions more simple to improve readability and reasoning and write clean-up code that keeps a consistent program state regardless of how the function exits.