Notifying the User in Function Chain

Topics: Exception Handling Application Block
Dec 18, 2007 at 8:40 PM
I wonder if the Exception Handling Application Block gives solution to the following problem:
Consider the following call graph:
UI calls A->B->C->.... exception happens
in this scenario function A should Notify the User.

But in scenario:
UI calls B->C->.... exception happens
function B should Notify the User


Any of function A, B, C could be directed called by user and being called inside the chain.

How one can cause to fire the notification only once, from the function that was called first in the chain?

Thank you
Dec 19, 2007 at 1:02 PM

Can't you rearrange your functions so that the chains are really:
UI -> A -> B' -> C -> ...
UI -> B -> B' -> C -> ...
and do the proper user notification in A and B?

Even if you could have a handler that notifies to the user based on the stack, the configuration for the Post Handling Action doesn't belong to the handlers.

Dec 24, 2007 at 9:42 PM

Nice idea, Fernando, needs some refactoring, but works. thank you!
I wonder if some solution in logging/exception handling could introduce some bit(s) (per thread) that a function can set/unset. thus informing and changing the behavior of all its callees in call stack?