Are you sure that line 4 is not executed?
Have you tried a step in the debugger?
Are you sure that line 4 doesn’t fire another KeyNotFoundException and so you saw the global KeyNotFoundException alert message?
Just tried this:
dim jrecord as new jsonitem //empty so I’m sure it will trigger the KeyNotFoundException
dim jdata as jsonitem
jdate = jrecord.Child(“releasegroups”).Child(0).Child(“releases”).Child(0).Child(“date”)
catch err as KeyNotFoundException
//jdate = jrecord.Child(“releasegroups”).Child(0).Child(“releases”).Child(1).Child(“date”)
The step debug works as expected and noglobal KeyNotFoundException alert message is fired.
Are you running in the debugger ?
Do you have “break on exceptions” in the Program menu enabled ?
If so then the exception IS being raised & the debugger is showing you that - by breaking into the debugger
Stepping will show you whether your code handles the exception or not
If you turn that setting OFF then exceptions will not break into the debugger but WILL probably cause your debug app to raise an exception & cease working
Its always been caught as long as your code was catching things correctly.
The “break on exceptions” just did a break when the exception was raised - you could still hit RESUME at that point or step to watch your code catch the exception.
I pretty much leave that setting on all the time as it can help me find exceptions that I am NOT expecting