Catch JSONException but continue loop

Can anyone point out how to bypass JSONExceptions and continue on in a For Loop?

I have tried the below but it stops at the error every time.

For i As integer = Min.Text.ToInteger to Max.Text.ToInteger
  dim db as database = Session.db
  dim url As String = ""+ i.ToString + "&categoryId=1"
    dim socket1 As New URLConnection
    socket1.RequestHeader("x-user-jwt") = app.JWT
    Var origin As String = socket1.SendSync("GET", url, 20)
    Var json As New JSONItem(origin)
    Var jsonData As JSONItem = json.Value("data")
    Var item As JSONItem = jsonData.ValueAt(0)
  Catch e As JSONException
    Continue For I
  End Try
Next I

It looks like I was doing it right. I had a key exception error that I wasn’t accounting for.

1 Like