Author Archives: David Brownell

Error Handling with Exceptions: Where to Catch

By | November 16, 2010

This article is part of a longer running series on Error Handling with Exceptions. Determining where to catch an exception can be one of the most difficult aspects to overcome in becoming comfortable with exceptions. These rules provide clear guidance and simplify the process by removing ambiguity. Please note that this article’s scope is limited […]

Read more »

Error Handling with Exceptions: How to Throw

By | November 8, 2010

This article is part of a longer running series on Error Handling with Exceptions. Fortunately, throwing exceptions is very easy in most languages, and the best recommendation is to throw in such a way that all information required by the exception is populated. When creating custom exception types, care should be taken to ensure that […]

Read more »

Error Handling with Exceptions: What to Throw

By | November 3, 2010

This article is part of a longer running series on Error Handling with Exceptions. Fortunately, there are only a couple of things to keep in mind when throwing exceptions (and most of these requirements are built into the language or codified through convention). What to Throw Exception types should be specific to an error Exception […]

Read more »

Error Handling with Exceptions: When to Throw

By | November 1, 2010

This article is part of a longer running series on Error Handling with Exceptions. It can be a challenge to know when to throw exceptions and, unfortunately, the common guidance to throw in exceptional circumstances doesn’t do much to clarify the confusion. In this article, I will put forward postulates of when to throw exceptions […]

Read more »

Error Handling with Exceptions: Why Exceptions

By | October 28, 2010

This article is part of a longer running series on Error Handling with Exceptions. In today’s landscape, there are two primary means of handling errors within an application: exceptions and error codes. Working under the assumption that a clear and consistent error handling strategy is a Good Thing, the following is a brief list of […]

Read more »

Error Handling with Exceptions: Abstract

By | October 28, 2010

A series of articles regarding error handling with exceptions. Error Code Fail Why Exceptions When to Throw What to Throw How to Throw Where to Catch What to Catch What to do With a Caught Exception The Strong Exception Guarantee Testing for the Strong Exception Guarantee Generic Customization of Exception Messages Windows and SEH Exceptions […]

Read more »

Error Handling with Exceptions: References

By | October 27, 2010

This article is part of a longer running series on Error Handling with Exceptions. The following books and articles have been invaluable over the years as I have investigated exceptions and exception-related issues. In most cases, they have stated things far better than I could ever hope to. Articles Abrahams, David. “Exception-Safety in Generic Components“ […]

Read more »

Error Handling with Exceptions: Error Code Fail

By | October 26, 2010

This article is part of a longer running series on Error Handling with Exceptions. Right around 2000, I began to explore error handling via exceptions. There were many things I liked about exceptions; as a designer, I could: Ensure that users processed error conditions Provide rich contextual information along with the error itself Unfortunately, I […]

Read more »

Hello (again!)

By | October 25, 2010

After time away from blogging, I have decided to spend some time here and there writing about things that I am actively working on. I have really enjoyed a number of articles that have appeared on dzone.com over the past couple of months and hope that I can contribute to the discussion where appropriate. In […]

Read more »