💡
21
c/career-advice•kim.jakekim.jake•4d ago

Shoutout to the senior dev who called me out on my error handling

I used to just throw generic try-catch blocks everywhere and log nothing useful. Then at a code review last month, my lead at a small shop in Austin pointed out I was swallowing errors and making debugging a nightmare. She showed me how I was missing specific exception types for our payment API. Has anyone else had a moment where a small code habit was totally wrong for years?
3 comments

Log in to join the discussion

Log In
3 Comments
emerym36
emerym364d ago
Man, I once spent four hours debugging a missing semicolon lol.
6
amy_anderson
That "swallowing errors" bit hit close to home. I caught myself doing the same thing for like two years. Had a service that would just silently fail on payment timeouts. My boss had to trace a bug for three days before he found it. Now I always make sure I'm catching specific exceptions and logging the stack trace. Also started adding context like order IDs or user sessions. Makes a huge difference when you're trying to figure out what broke at 2am.
4
lewis.finley
Wait, @amy_anderson are you saying you went two years without catching specific exceptions...? That's rough but honestly I've been there too. The worst part is when you realize how many hours you wasted because you were too lazy to write proper error handling in the first place. Now I always add those little context details like timestamps and user IDs to my logs, even if it feels like overkill at the time. Those 2am debugging sessions are brutal enough without having to guess what went wrong.
1