Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Not able to catch exceptions

Again, we need Minimal reproducible example code.
plasmax

Re: Not able to catch exceptions

martin wrote:

Well, this looks like VB.NET, not WinSCP question.
Consider asking it on Stack Overflow instead.
In any case, we/they will need to know more details (minimal reproducible example).


All other errors in the application are trapped and displayed successfully. It is only when an exception is thrown by WinSCP functions that this happens. The application i'm developing is a Windows Service VB.NET application using .NET 4.6.1. The error I am testing with is an invalid path on the remotepath for putfiles(). The exception is thrown after i call transferResult.Check() but the exception object is coming through as null. I just created a windows forms app to test the same scenario and it works as it should with the exception object being populated. I will put this on StackOverflow if I can't get an answer here, but I thought that someone else using WinSCP may have encountered this a well.
martin

Re: Not able to catch exceptions

Well, this looks like VB.NET, not WinSCP question.
Consider asking it on Stack Overflow instead.
In any case, we/they will need to know more details (minimal reproducible example).
plasmax

Not able to catch exceptions

I'm having a really weird issue with not being able to trap exceptions, specifically with PutFiles() in vb.net. I have my application working but when their is an error thrown by transferOperationResult.Check() it procedes to the catch block but when i try and display the error with the following code, it errors out again.
 Try

        transferResult = session.PutFiles(fileToSync, sp.RemotePath, False, transferOps)
        transferResult.Check()
  Catch ex As Exception
          If m_logginglevel > 1 Then
          WriteToEngineLog(MessageType.Information, "Error performing transfer: " & ex.message)