paint-brush
How Not to Deal With Errors in Frontend Appsby@playerony
1,845 reads
1,845 reads

How Not to Deal With Errors in Frontend Apps

by Paweł WojtasińskiMay 22nd, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Let's explore the upside-down world of what not to do when dealing with errors in frontend apps. Ignoring errors or not setting up proper logging can lead to small issues snowballing into major headaches. Don't just fix errors, understand them, learn from them and use the right tools to prevent them from happening again.
featured image - How Not to Deal With Errors in Frontend Apps
Paweł Wojtasiński HackerNoon profile picture

Let's take a step into the looking glass for a moment and explore the upside-down world of what not to do when dealing with errors in frontend apps. This could get weird, so buckle up!

Introduction

Every developer's nightmare: errors on production. You've been there. I've been there. But instead of talking about how to solve these problems today, let's discuss how NOT to deal with them.


It's a bit unusual, I know, but sometimes seeing things from another perspective can lead to valuable insights. Let's dive in.

Ignoring Errors

First up, the worst offender of all – ignoring errors. There are those who live by the 'no news is good news' rule, and if they don't see any problems, they assume all is well. Unfortunately, in the digital realm, no news often means we're just not hearing the bad news.


Ignoring errors or not setting up proper logging can lead to small issues snowballing into major headaches.

Not Reproducing the Error

Now, onto my second point. How many times have you seen someone – or maybe it was even you – try to fix an error before even reproducing it? It's like trying to hit a target blindfolded. Sure, you might hit something, but chances are it's not what you intended.


Without reproducing the error, we're shooting in the dark.

Relying on Users for Error Reporting

Third, we have the classic reliance on users for error reporting. Users are great, they're the reason we build apps. But depending on them to be your primary source of error reporting is like asking your grandma to debug your code.


She might stumble upon an issue now and then, but she's not going to provide the detailed report you need.

Not Using Debugging Tools

Then there's the underutilization of debugging tools. With so many out there – like Sentry, for example – it's a crime not to use them. It's like having a toolbox full of shiny tools and trying to fix everything with duct tape. Sure, duct tape might work in a pinch, but it's not a long-term solution.

Not Learning From Mistakes

Finally, we have the age-old problem of not learning from our mistakes. If we don't take the time to understand why an error occurred, we're bound to see it pop up again. And there's nothing more frustrating than fixing the same issue over and over.

Conclusion

There you have it, a journey through the mirror into the world of what NOT to do when dealing with frontend errors. It's a bit unusual, but I hope it gave you some fresh insights. The key takeaway here: don't just fix errors, understand them, learn from them, and use the right tools to prevent them from happening again.


And remember, even though we're in this upside-down world, don't forget to have fun.