C
Chad Z. Hower aka Kudzu
Its a bit tough to explain why I need this, so I wont. Consider it academic for now.
I would like to detect if an exception is currently being thrown, but I cannot use a try statement. This
is not what I want to do, but this will demonstrate what I want to do:
try
throw exception
finally {
Foo();
}
Foo() {
if (An Exception is currently being thrown/handled) {
Do sometihng
}
}
I realize in the above case I coudl use catch, pass it as an argument, and re throw. But for the actaul
situation Im looking at, I cannot do that and will not have access to a catch.
Ive looked at StackTrace, but it does not seem to hold this information either unless Ive missed it on
quick glance. In Delphi there is a "global" that holds the current exception for the current thread. Is
there anything like this anywhere in .NET, or any way to obtain it?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
I would like to detect if an exception is currently being thrown, but I cannot use a try statement. This
is not what I want to do, but this will demonstrate what I want to do:
try
throw exception
finally {
Foo();
}
Foo() {
if (An Exception is currently being thrown/handled) {
Do sometihng
}
}
I realize in the above case I coudl use catch, pass it as an argument, and re throw. But for the actaul
situation Im looking at, I cannot do that and will not have access to a catch.
Ive looked at StackTrace, but it does not seem to hold this information either unless Ive missed it on
quick glance. In Delphi there is a "global" that holds the current exception for the current thread. Is
there anything like this anywhere in .NET, or any way to obtain it?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/