Error Reporting - WeOnlyDo Discussion board

Error Reporting (General questions)

by Jason, Thursday, December 22, 2005, 16:13 (6914 days ago)

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

by wodSupport, Thursday, December 22, 2005, 17:38 (6914 days ago) @ Jason

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

by Jason, Thursday, December 22, 2005, 17:43 (6914 days ago) @ wodSupport

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

by Jason, Thursday, December 22, 2005, 17:54 (6914 days ago) @ Jason

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

by wodSupport, Friday, December 23, 2005, 00:16 (6913 days ago) @ Jason

This is now fixed. Please request update. Thanks for pointing this out!

Re: Error Reporting

by Jason, Friday, December 23, 2005, 02:26 (6913 days ago) @ wodSupport

Thanks, Kreso! As always, you rock!

This is now fixed. Please request update. Thanks for pointing this out!