Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 95011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:35:29+00:00 2026-05-10T23:35:29+00:00

Ever since Microsoft has introduced the application blocks, I’ve been bumping into people who

  • 0

Ever since Microsoft has introduced the application blocks, I’ve been bumping into people who use the Exception Handling Application Block. I’ve recently had a closer look myself and would summarize the basic functionality as follows (skip the following block if you already know what it does):

The exception handling application block aims to centralize and make fully configurable with config files the following key exception handling tasks:

  • Logging an Exception
  • Replacing an Exception
  • Wrapping an Exception
  • Propagating an Exception
  • etc.

The library does that by having you modify your try catch blocks as follows:

try {   // Run code. } catch(DataAccessException ex) {     bool rethrow = ExceptionPolicy.HandleException(ex, 'Data Access Policy');     if (rethrow)     {         throw;     } } 

Based on what is specified in the app.config for the policy name (see here for docs), HandleException will either …

  • throw a completely new exception (replace the original exception)
  • wrap the original exception in a new one and throw that
  • swallow the exception (i.e. do nothing)
  • have you rethrow the original exception

Additionally you can also configure it to do more stuff beforehand (e.g. log the exception).

Now here’s my problem: I completely fail to see how it can be beneficial to make it configurable whether an exception is replaced, wrapped, swallowed or rethrown. In my experience, this decision must be made at the time you write the code because you’ll typically have to change the surrounding or calling code when you change the exception handling behavior.

For example, your code will likely start to behave incorrectly when you reconfigure such that a particular exception thrown at a particular point is now swallowed instead of rethrown (there might be code after the catch block that must not be executed when the exception occurs). The same goes for all other possible changes in exception handling (e.g. replace -> rethrow, swallow -> wrap).

So, to me the bottom line is that the exception handling block solves problems that really don’t exist in practice. The exception logging and notifying bit is fine, but isn’t all the other stuff just a perfect example for overengineering?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:35:29+00:00Added an answer on May 10, 2026 at 11:35 pm

    If you use exceptions for control flow, then you would want to stay away from policy-based exception handling.

    But in the case of exceptions which you want to treat as non-recoverable (a background task failed, the socket was disconnected, the file was deleted, etc.), you may want to have configurable, policy-based exception handling.

    For example, if you are developing an API, you may want to have every function in your API throw only the standard exceptions (ArgumentException, etc.), as well as your own library-specific exception in the case of an inner non-standard exception (e.g. a MyLibraryException). In this type of case, all that matters is that something did not work correctly. You are not picking apart the exception and figuring out what went wrong. You are simply acknowledging the fact that something went wrong, and that you are supposed to do something now.

    That something should be configurable, because it doesn’t really matter what you do. Display a Message Box to the user? Modal or non-modal? Log the exception? How do you want to log the exception? Call a logging web service? Append to a log file? Write to the Windows Event Log? Insert an entry into the database? Insert an entry into two databases? It doesn’t really matter to the rest of your application. The choice of how to handle an exception is completely orthogonal to the rest of the application.

    (As an aside, this is not how I would approach configurable policy-based exception-handling. I would tends more towards an AOP style, such as registering an exception-logger interceptor in the container.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 239k
  • Answers 239k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To the best of my knowledge, asymmetric latencies -- especially… May 13, 2026 at 6:57 am
  • Editorial Team
    Editorial Team added an answer Best way to think of it is: relative vs absolute… May 13, 2026 at 6:57 am
  • Editorial Team
    Editorial Team added an answer I'm uncertain what your question is. Are you trying to… May 13, 2026 at 6:57 am

Related Questions

Ever since Microsoft has introduced the application blocks, I've been bumping into people who
IBM Cognos TM1 is a multidimensional database that my company thinks is the latest
First, let me use one sentence to let out some frustration: My god, developing
OK, this might sound a bit confusing and complicated, so bear with me. We've
I've been a Microsoft developer ever since I started programming... I started out by

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.