I am trying to trap a JSONException (err # 1 - Parse Error) but I can’t seem to do it (at least not in the debugger). The following code always stops on “theJSON.Load()” line, I never get the message box. Same thing if I use an Exception block.
[code]Dim content As String = “This is not valid JSON”
Dim theJSON As New JSONItem
Try
theJSON.Load(content)
Catch err As JSONException
MsgBox(“Parse Error”)
End Try[/code]
Am I missing something?
Gave you got Project > Break On Exceptions enabled ?
If so this is normal and the debugger will break where the exception is raised
BUT you can simply hit continue & the code will carry on
It simply allows you to see where exceptions are raised then step through you error handling code
Or you can turn break on exceptions off
Mostly I only do thins once in a while but leave break on exceptions on
And you can programmatically turn the break on exceptions behaviour off temporarily with
#pragma BreakOnExceptions false
[quote=430634:@Norman Palardy]Gave you got Project > Break On Exceptions enabled ?
If so this is normal and the debugger will break where the exception is raised[/quote]
Bingo. I was missing something
Thanks