Return error code value = 1

Advertisement

philip123
Joined:
Posts:
6

Return error code value = 1

Hi,

I am using the Winscp dll with C#. I am trying to get some error handling in our code. For testing the "remote server down" or "not connected", I tried to use some imaginary or unknown server IP address. The return value seems to be always the value of "1". But the Winscp log says "Proxy error: SOCKS proxy did not accept our authentication".

Is there a way to setup proper code so that it can catch the server down or not connected? (any sample code)

On other things, if the code connected to the remote server and there is no file to be found on that server, then the return value will still be 1.

Any way to make it different return value?

Thanks.

Phil

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
34,300
Location:
Prague, Czechia

Re: Return error code value = 1

I'm not sure what you mean. WinSCP .NET assembly does not have any exit codes.
With the assembly, you know whether an exception is thrown by Session.Open or Session.PutFiles.

If you mean WinSCP scripting, it indeed has only 0 and 1 exit codes.
https://winscp.net/eng/docs/scripting#result

Reply with quote

Advertisement

You can post new topics in this forum