Martin D Kealey wrote:

What about keeping track of where the exception was originally created?

If we have lazy exceptions, then knowing where the fault they represent was
detected is probably more important than were (exactly) it was triggered.

Or does this all amount to the same thing? Is an exception only "lazy"
because there's an enclosing dynamic scope that catches it and
transmogrifies it into an Uncaught Exception?

Or if not, could we have both back-traces available? A "created_by" back-trace
and a "thrown_by" back-trace?

Theoretically, yes. But 99% of the time, the useful information is where the exception was thrown, so the extra effort of tracking both doesn't add enough value to be worth it. But, if someone did need to track both (perhaps for a research project), they could just subclass the Exception class and add a creation backtrace.

Allison

Reply via email to