Re: Newbie Question on Error Handling
- From: "David Levine" <noSpam12dlevineNNTP2@xxxxxxxxx>
- Date: Thu, 3 Nov 2005 04:04:07 -0600
Try setting the debugger to break on first chance exceptions....if the cause
is that an exception is getting thrown that the code is not catching this
will at least break at its occurrence, even if it occurs in 3rd party code.
It will also break in the context of the thread where the exception was
thrown.
"Figmo" <figmo@xxxxxxxxx> wrote in message
news:1130962147.128947.225640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hard to post "short but complete program" for this since it coming from
> a 3rd party component that you most likely do not have. And I don't
> have the source to the component to see how the error is occuring to
> try and re-create the original error on my own from a test program.
>
> I agree that it's nothing to do with the constructor because it just
> happened to me again from another function. It's wierd because it
> seems to exit ALL THE WAY back from the call stack. In other words - I
> have MethodA() that calls MethodB() and the error happens in MethodB().
> But if I put a breakpoint on the line in MethodA() after the call to
> MethodB() - I never get there either. So it's exiting not only out of
> MethodB(), but also out of MethodA() - all without giving me any
> indication of this or hitting any other lines of my code within my
> program.
>
> Oh well - I guess I'll just chalk this one up in my brain as
> "undocumented program behavior" on the part of VS.NET. It's not the
> end of the world. Just a little frustrating when I encounter this.
>
>
>
> Jon wrote:
>> Figmo <figmo@xxxxxxxxx> wrote:
>> > Here's some pseudo code
>> >
>> > public formCustomer() {
>> > InitializeComponent();
>> > 3rdPartyComponent component = new 3rdPartyComponent();
>> > m_var1 = component.ProcessThis("Invalid Data"); //...offending code
>> > m_var2 = component.ProcessThis("Valid Data); //...never gets here
>> > - but no errors reported
>> > }
>> >
>> > Could it be because the offending code is in the constructor of one my
>> > classes? I am wondering why C# just bails out of the constructor
>> > without reporting ANY sort of error or exception when it encounters
>> > this error.
>>
>> No, it's not because it's in a constructor. Unfortunately, without a
>> complete example it's impossible to say what's going on.
>>
>> Could you post a short but complete program which demonstrates the
>> problem?
>>
>> See http://www.pobox.com/~skeet/csharp/complete.html for details of
>> what I mean by that.
>>
>> --
>> Jon Skeet - <skeet@xxxxxxxxx>
>> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
>> If replying to the group, please do not mail me too
>
.
- Prev by Date: Thread and "callbacks"
- Next by Date: Re: why can't vs 2005 class designer do UML
- Previous by thread: Re: Newbie Question on Error Handling
- Next by thread: decrypt des ede3?
- Index(es):
Relevant Pages
|