WeSearch

Your trycatch sucks - lets fix it

·6 min read · 0 reactions · 0 comments · 19 views
#javascript#programming#errorhandling
Your trycatch sucks - lets fix it
TL;DR · WeSearch summary

The article discusses the importance of effective error handling in programming. It outlines various levels of error handling practices, from basic to advanced techniques. The author emphasizes that good developers anticipate errors and build systems that can recover from failures.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 728097) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Shuvo Posted on May 21 Your trycatch sucks - lets fix it #javascript #typescript #programming #coding You're not handling errors. You're hiding them. Every app crashes. Every API fails. Every database hiccups at 2am on a Friday. The difference between a good dev and a great one? What happens next. Let's roast your error handling — then make it legendary. 🤦 Level 0: The "Trust Me Bro" Dev No try/catch at all. Just vibes.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)