Re: Exception Handling - help!
From: George (George_at_discussions.microsoft.com)
Date: 11/03/04
- Next message: George: "Re: Exception Handling - help!"
- Previous message: Justin Rogers: "Re: Rotor Bug: TimeZone ToLocalTime"
- In reply to: David Levine: "Re: Exception Handling - help!"
- Next in thread: David Levine: "Re: Exception Handling - help!"
- Reply: David Levine: "Re: Exception Handling - help!"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 02:27:02 -0800
Hi David,
thank you very much for the answer.
> the only
> language that supports user filters is VB,
right. After I sent the post, I installed and tried myself examples in VB.
> and it does not support calling
> methods, only evaluating simple expressions. To call a user-filter you would
> have to write the code directly in IL.
I don't agree :-) I tried out examples where the "when" clause of a catch
contains a method call. Something like:
Catch exc As System.Exception When m(0) < 5
In turn, "m" could call "n" and so on ...
> Since the stack has not yet been unwound then any methods
> invoked during the user filter would have to be on top of the stack, which
> implies that those routines also have access to the stack frame in which the
> original exception occurred
are you sure these routines have access to the faulting frame? I think
rather not. They are in completely different frames.
> If another exception occurs within a user filter then the runtime would have
> to treat this as a nested exception.
I tried examples in VB and I guess they do the following:
if an exception occurs in a filter (i.e. in pass 1), then it starts a new
exception propagation. It looks for a suitable handler. Upon propagation, if
this exception reaches our filter, then the 1st pass of this second exception
finishes - further the second pass is executed. Finally, our filter is
considered as it would have returned 0 (i.e. "continue search"). Please
someone contradict me if I'm wrong!!
In this situation, we return to the 1st pass of the initial exception,
looking for another catch or filter.
> This isn't well
> documented.
I definitely agree with you!!
> After the user filter executes, if it returns a value that tells the runtime
> to execute the handler the runtime then remembers the catch block that will
> handle the original exception, executes the 2nd pass, which executes finally
> blocks, and this continues until the stack is unwound and control resumes
> within the catch handler.
You are right!
One again many thanks!
George
- Next message: George: "Re: Exception Handling - help!"
- Previous message: Justin Rogers: "Re: Rotor Bug: TimeZone ToLocalTime"
- In reply to: David Levine: "Re: Exception Handling - help!"
- Next in thread: David Levine: "Re: Exception Handling - help!"
- Reply: David Levine: "Re: Exception Handling - help!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|