Peter Morlion logo

Exception handling basics

Every now and then, I encounter smart developers that seem to misunderstand how exceptions and exception handling works. Often regardless of language or technology stack. While I don’t see these issues daily, I thought it might be interesting to reiterate on some exception handling basics. Rethrow correctly In .NET, it’s important to rethrow exceptions correctly. […]

Exceptions everywhere

On two projects I have worked on, I’ve seen a lot of this: public void DoSomething() { try { // actually do something here } catch (Exception ex) { throw new Exception(“Unable to do something”, ex); } } I’ve seen this in various differing styles: not including the original exception in the newly thrown one […]