0 votes
by (310 points)
edited

I am a bit of a newbie, so be patient. I downloaded the rebex trial software for FTP for a windows CE 5.0 build using compact framework 2.0. Everything works as advertised and rather easy to use. We will end up buying the software. Anyway my issue is catching a bad ftp address and prompting the user for a correction. The code I used is:

    Dim loginerror As String
    Dim error_exit As Boolean
    error_exit = False

    Try
        client.Connect(web_address)
    Catch ex As Rebex.Net.ProxySocketException
        error_exit = True
        loginerror = ex.Message.ToString
    End Try

When I execute the above snippet with a proper address, all is fine, but when I on purposely insert a bad address, The catch does not work and the system crashes. What am I doing wrong???

2 Answers

0 votes
by (73.6k points)
edited
 
Best answer

This is feature of the VS 2008 in debug mode. It informs you the exception of type ProxySocketException was raised (but within the Connect method). The Connect method doesn't throw the ProxySocketException.

I was able to reproduce it when instructed the VS to break when the ProxySocketException is thrown. It can be set in menu Debug->Exceptions...->find the ProxySocketException and check column "Thrown".

Desired action is to uncheck "Thrown" checkbox.

Actually, when the VS break because of the ProxySocketException, you can run further typically by pressing F5 (menu Debug->Continue).

by (310 points)
edited

Sorry for the delay, but this question should be marked as answered, thanks greatly for all the help.

by (148k points)
edited

Thanks for letting us know!

0 votes
by (73.6k points)
edited

Just catch Rebex.Net.FtpException instead of the ProxySocketException.

by (310 points)
edited

Thanks for the reply, I switched the statement to catching the FTP.Exception, this works only if I am running my device in real time, when I am running the code via VS 2008 to my target device, VS 2008 kicks up an REBEX.PROXYSOCKETEXCEPTION error as being un handled and kicks me out of the program. Its a bit harder to debug my program this way, but at least this error does not appear when running in real time. I am not sure what the difference is. I do know that if I on purposely screw up the client.login code, this never throws an un handled exception error. Wether I am running in a debug mode to my device or running in real time. Do you have any thoughts about this?

...