Same handlingInstanceID when an exception was already handled by the block
Exception Handling Application Block
It would be very useful if an exception that was already handled by the block uses the same handlingInstanceID generated the first time it was handled so you can associate all the exception chain as only one error.
If the exception was already handled the block uses the same handlingInstanceId generated before, if not then it generates a new one.
e.g. Supose that you show the handlingInstanceId to the user as a ticket number of the error. You want to track down what happen using that ticket number, but if your model handles the exceptions in every layer, you get a different handlingInstanceId from the one that originated the problem and thus it can be difficult to find the first exception ocurred in the exception chain.
Using the approach found in "What Does the Exception Handling Application Block Do?" from the documentation of EntLib 5.0 you could end up with this:
- First Exception occurs at the Data Layer and is handled, logged and wrapped, and gets a handlingInstanceId.
- Exception handled at the Business Layer, logged and propagated, gets a NEW handlingInstanceId.
- Exception handled at the Business Layer, is replaced with another exception, gets a NEW handlingInstanceId.
- UI Layer shows the last handlingInstanceId (which is the one that it can see and is not related to the first Exception).