When a program executes, each method is given a "stack frame" as an
area for temporary storage. Local variables and a return address to
the caller are often stored in the stack frame.
When a method calls a second method, a new stack frame is generated
for the call. When the second method returns that new stack frame can
be cleaned up - it's just temporary storage for one method call.
When there is an exception you can not only tell where you are, but
where you have been by looking at a 'stack trace'. A stack trace
examines the active stack frames on the thread to see how you arrived
at this point.
You can start digging into stack frames yourself by looking at the
StackTrace property of an exception.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 3 May 2005 07:00:14 -0700, Nirbho
<Ni****@discussions.microsoft.com> wrote:
Hi,
I'm newish to C# .Net. I'm doing some error handling in my ASP.net pages.
When handling the error in the catch block, I want to pass through the
namespace of where the error occured.. something like
"application.page.method" - I could hardcode this for every ASP.net page, but
I'm sure there must be something in .Net that gives me this for free.
Does anyone know of something I could use?
Cheers!