[RESOLVED] [2005] WebException halts execution
When I use this code...
VB Code:
Private Function CheckURL(ByVal site As String) As Boolean
Dim request As System.Net.WebRequest
Try
Dim url As New System.Uri(site)
request = System.Net.WebRequest.Create(url)
Dim response As System.Net.WebResponse = request.GetResponse()
response.Close()
request = Nothing
Return True
Catch
request = Nothing
Return False
End Try
End Function
With...
VB Code:
MsgBox(CheckURL("http://www.google.com"))
MsgBox(CheckURL("http://www.googlexyz.com"))
the IDE stops execution on the second URL and throws up the exception dialog box. If I step it forward, it moves onto the Catch correctly. Is there a way to prevent the IDE stopping when it hits a WebException? (It only seems to do this with a WebException). I'd like the code to proceed onto the Catch without my intervention.
If I build the solution, it works correctly (but then I cant do any debugging).
Re: [2005] WebException halts execution
I think I've answered my own question...
Debug -> Exceptions.. -> Uncheck the System.Net.WebExceptions "Thrown" checkbox