[Autogenerated] Let's go back.
To our code here, looking at the calculator.
If our press 55 to run this and We divide by zero, we get that exception.
That's because we handled the exception properly.
We can continue running everything seems to be fine,
but we didn't get a break point when the exception occurs,
which means that that divide by zero exception wasn't
set for a first chance exception, but only to a second chance,
which means that only If we don't handle the exception,
we'll get a break point,
in the debugger maybe we would like to actually
find out exactly when that thing, is happening.
So we'd like to configure the debugger to stop at first chance.
Let's see how to do that The first thing we need.
To do is to tell,
Visual Studio that We're interested in that particular
exception by going to the exception settings,
window.
If you don't see it, you can go to the debug menu,
Windows and exception settings, to make that appear you.
Can see there,
is a long list of exceptions here segregated into various
categories such as .NET exceptions, and Java exceptions,
and other exceptions like only 32 exceptions,
which are the exceptions.
We're.
Actually interested in in this particular case.
In the case of divide by zero.
We can of course, just simply search Let's look at divide something.
See what we find.
So you can see There, the system divide by zero exception,
but that's a .NET exception.
That's not the one I'm looking for.
Let's search for something else like zero.
So that's integer, division by zero.
That's the exception we're interested in and Notice it,
is not checked, not checked means, that It's not going.
To be Break in on first Chance.
Let's check it once I check that it will break on first
Chance if we try to divide by zero.
So if I do something, that doesn't cause an exception.
It's all fine.
If I go ahead.
And divide by zero.
We're going to get a break point here.
First chance indicating exactly where that exception occurs.
Then we can continue running by pressing F,
five and Since we are handling the exception normally or correctly.
We can even of course,
specify a break point if we so desire we can
continue running normally everything.
Is just fine.
I pressed F five, we can continue running.
But in general, in some cases, you might have an exception.
That you might make that You might that you might find it difficult.
To figure out its source You might want to try to Look at the
first chance if it doesn't occur for you.
So here's another example, that We didn't handle something like a plus B.
We don't really support in these simple expression parser,
any kind of variables.
So I'm going to get an exception here.
And that exception, says that There some in environment argument,
this is In fact, a high level exception,
asp plus plus exception, but there's the second chance here.
Is saying, hey,
the raise exception here after that we're going to Simply crush the
process if our press their five We're going to _____ the process or
at least continue forward In this case,
the cs plus plus handler behind the scenes for the C++ down
library decided to continue running anyway.
But obviously, it's something we'd like.
To See when that thing, is happening.
And Currently this is probably second Chance, and we can look, that up as well.
In the exception settings.
So we're talking here about something called in environment argument.
Let's quickly search for that So we have invite argument here somewhere.
That's .NET we don't care about that So uh see plus plus exceptions,
invite argument.
In fact, we see that We have a first chance here,
but that's not the one this is uh based on platform
That's a win our T exception.
Its probably not the one that we're looking for.
Let's try something else here.
Um, that is exactly what we need.
So, in this case, it might not even exist as a separate exception.
We might just go ahead.
And look for all C++ exceptions,
which are not in this list by checking this button here.
And then we can try this again.
See what that looks like you.
Can see we're breaking again.
But this time notice its its the first chance exception here.
Notice it.
Says exception raised its not saying unhanded exception
because an attempt wasn't yet made.
To Try to handle the exception so you can play with
that and that might make it easier.
To figure out why things are not working as, as expected.