Relative Content

Tag Archive for exception-handling

How should I handle logger failures?

In several of our company’s applications, we use a custom logger. It’s fairly robust, though we may replace it with something like NLog in the future. One of the logger’s tasks is to log any exceptions encountered in the application.

Replacing Throwing Exceptions with Notification in Validations

Martin Fowler recommends replacing exceptions with notifications when dealing with validations. Essentially, instead of throwing an exception, you append error messages to a Notification object that gets returned. This allows you to keep exceptions to “exceptional” circumstances, and return all the validation information, not just the first one checked.

Replacing Throwing Exceptions with Notification in Validations

Martin Fowler recommends replacing exceptions with notifications when dealing with validations. Essentially, instead of throwing an exception, you append error messages to a Notification object that gets returned. This allows you to keep exceptions to “exceptional” circumstances, and return all the validation information, not just the first one checked.