I bet you could write a function decorator (call it @exceptiontracking) that automagically creates a new exception for each function, but also keeps track of whether that function was called by itself ...