Posts about Exceptions

Throwing exceptions

Throwing exceptions is in itself trivial. Just invoke throw with an exception object. But when should you throw? Should you create a new exception or rethrow…

How to design exceptions

This article will teach you how you should design your exception classes. It’s a follow up to my previous article which told you what exceptions are and their…

What are exceptions?

This blog has been quiet for a while. I am currently writing a book about localization. Me and my partner are also getting close to release of our new…

Dealing with exceptions, Logging and displaying error messages

I’ve got a client which is really firm that the user should know what went wrong when exceptions are thrown. So we are displaying error messages like

When to throw exceptions

I’ve written several posts about exceptions. For instance when you should catch them or how you should design them. In this post I’ll discuss when you should…

How to handle errors in ASP.NET MVC

There are several blog posts regarding error handling for ASP.NET MVC. They use everything from Application_Error to exception handling in the base…

The art of creating exceptions

Please take a moment and think about WHY you throw exceptions.

Common mistakes when working with exceptions

This is an evil one, because it’s really easy to do and the compiler does not complain about it (it should be easy for the compiler to spot). The code also…

InvalidOperationException: “Exception” in disguise? Or just the new ApplicationException?

Microsoft added ApplicationException with the idea that all exceptions that you made should derive from it. Fair point, you should be able to handle your own…

Do NOT catch that exception!

Ohhh, I’ve recently seen one too many applications where the developers try to be safe by catching exceptions all over the place. It can be everything from a…