Does putfiles method throw exceptions without .check() method?
I have been using WINSCP for some time now, but recently I am running into a exception that say, "The specified network name is no longer available".
to handle the exception manually, I removed .check() method for later and did the following
What is happening is that the putfile method itself throws an exception without .check() and thus skips the whole logic for retry. Is that normal for PutFile() method?
The WinSCP version is as shown below:
5.9.2.6958
to handle the exception manually, I removed .check() method for later and did the following
Console.WriteLine(("Uploading file " & Convert.ToString(Me._filesToDeliver(i)) & " to ") + inFTPRequest.RemoteDirectory)
transferResult = sftpSession.PutFiles(Convert.ToString(Me._filesToDeliver(i)), inFTPRequest.RemoteDirectory, False, transferOptions)
isSuccess = transferResult.IsSuccess
If (isSuccess = False) Then
Console.WriteLine("Upload failed: " & transferResult.Failures(0).ToString)
'retry twice on network failure
retry = 1
Do While (isSuccess = False And retry <= 2 And transferResult.Failures(0).ToString.Contains("The specified network name is no longer available"))
Console.WriteLine("Retrying against network issue(" & retry & ")")
Thread.Sleep(SFTPSleepInterval) 'sleep interval
transferResult = sftpSession.PutFiles(Convert.ToString(Me._filesToDeliver(i)), inFTPRequest.RemoteDirectory, False, transferOptions)
isSuccess = transferResult.IsSuccess
retry += 1
Loop
transferResult.Check()
End IfWhat is happening is that the putfile method itself throws an exception without .check() and thus skips the whole logic for retry. Is that normal for PutFile() method?
The WinSCP version is as shown below:
5.9.2.6958