Posts

Showing posts from September, 2012

Re-Throwing Exceptions Across Project and Process Boundaries

In reworking a customer’s error handling framework, I wanted to be able to write one error capturing process without having to reference the code across different projects.  I simply wanted to catch the error at the point of failure with a try-catch, perform any error handling locally and then rethrow the error to the calling UI process so that the UI layer could decide what message to display.  So for a database duplicate key I could display, something like "Item already exists".  I also wanted to capture the error in one project.  I didn’t want the error capturing results spread across different machines when the solution is scaled if the database was unavailable to house the error.  Also, because different applications shared the same middle tiered objects, I didn't want extra logic to determine the what UI was making the call when capturing the error.  I wanted a simple but elegant solution.  Logically, it seemed to me that this should be done not at the place the