A software engineer explains how to keep one bug from crashing your whole app. Use try-catch blocks and error isolation so a single failure doesn't become a system-wide disaster. Set up monitoring tools like Sentry to catch errors before users do.
Chapters
Try not to die from a cold. There's a technical term for this, which is having faults turn into failures, which is where you have a local problem in your system turn into a global cascading catastrophe. You'll find in many cases it is helpful to have your errors bomb out because it gives you easy error messaging, but as you move towards production, you're going to want to isolate your errors. This involves using things like try-catch, involving things like doing some preconditions on your backend endpoints. To basically try to isolate it. So it's not so much to even prevent anything bad from happening, but that when something bad does happen, it doesn't blow up the whole system. Going with that is going to be the idea of observability, where you want to have some sort of reporting mechanism that when you have an error, it gets reported back up. And this of course requires you to know the error happened in the first place, which requires you to have the try-catch, etc. For front-end systems, this is relatively straightforward. You can use a service like Sentry or Bugsnag and they'll take care of everything at the browser level. If you're using a no-code backend, you have to write something yourself, but either way, it is worth not dying from a cold.