Error Reporting (General questions)
Hi,
Below is a section of code I'm running to connect to an SSH Server (Which right now doesn't exist on IP's I'm trying to connect with). In the design environment it seems like the try...catch statement isn't working properly. I'm actually getting a design enviroment error for an unhandled exception of type System.Net.Sockets.SocketException in the weonlydo DLL. The error is No connection could be made because the target machine actively refused it. My issue isn't the error...my issue is that the try catch statement below isn't picking it up. The actual ex.message is Timeout occurred due to inactivity
Any idea what's causing this behavior? BTW, using 3.0.1 of the SFTP .NET Component.
-Jason
[code]
Try
'Try to clear out the client state
If m_Client.State <> WeOnlyDo.Client.SFTP.States.Disconnected Then
ResetClientState()
End If
'Connect
m_Client.Connect()
'Log connection
WriteCommLogEvent(CommLogItem.EventTypeEnum.Connect, svrItem, Connection attempt successful. )
Catch ex As Exception
'Log error into event log
WriteCommLogEvent(CommLogItem.EventTypeEnum.Connect, svrItem, Connection attempt failed. & ex.Message)
End Try
[/code]
Re: Error Reporting
Jason,
so even you have try..catch it still shows exception in the IDE, is that right? Could it be it was thrown from another thread, and that's why it wasn't caught?
How can I duplicate this, can you share your code? If so, please zip it and send it on techsupport email.
Thanks.
Re: Error Reporting
It's funny you mention it. Actually, the whole process is taking place on another thread. The program is actually a windows service which I stripped the code out of and placed in a simple windows form for testing purposes. Sending the project might be a bit difficult, though, as it is a rather large project using a separate DLL and quite a few XML files. Let me try removing the threading process and see what happens.
Jason,
so even you have try..catch it still shows exception in the IDE, is that right? Could it be it was thrown from another thread, and that's why it wasn't caught?
How can I duplicate this, can you share your code? If so, please zip it and send it on techsupport email.
Thanks.
Re: Error Reporting
I've zipped up the project and emailed it with operational instructions. Containing it all in one thread didn't fix the issue. Thanks for any help you can provide.
-Jason
Re: Error Reporting
This is now fixed. Please request update. Thanks for pointing this out!
Re: Error Reporting
Thanks, Kreso! As always, you rock!
This is now fixed. Please request update. Thanks for pointing this out!