Let's say in one method I have
try {
callme();
}
catch
{
// handle callme exception
}
Now let's say callme() calls method1() which in turn calls method2() -- If method2() throws an exception should it get thrown back to method1()'s frame, which will then stop any further execution inside of itself and pass the exception thrown from method2() to callme()'s frame and back to the original stackframe?
Will the same occur if I am stepping through code? Or will VS2008 stop as soon as it sees an exception if it is not handled in the originating method?
I am throwing an Exception but then the debugger complains of:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
as soon as i hit the closing bracket of method2().
I'm a bit confused, I thought exceptions were supposed to be passed back all the way up.
At runtime, the exception will bubble up the call stack until one of the following happens:
When debugging the situation is a bit different because the debugger can be set to break on unhandled user exceptions. This could be what's happening in your case. Check the Visual Studio option Debug / Exceptions to see if your debugger is set to catch any unhandled exception before it bubbles up and out of user code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With