I expect the URLConnection’s Error event to fire on any error so I can handle it there, but instead the code throws a NetworkException exception. Is this a bug?
dim Downloader as new URLConnection
AddHandler Downloader.error, AddressOf DownloadError
Downloader.SendSync("GET",URL, DownLoadFile,15)
To follow up with some more info, the docs aren’t really clear but it seems like the events aren’t raised if you are using SendSync. Switching to asynchronous request (Send) will raise events.
I would especially recommend this for a Check for Updates function, otherwise your whole app freezes while it awaits a response. You can subclass URLConnection and use the ContentsReceived event to parse the response and alert the user.