SFTP opendirectory exception issue/question

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

SFTP opendirectory exception issue/question

Post by snorkel » Tue 14 Dec 2010 17:30

Hi,
I am using the SFTP opedirectory command and when a directory does not exist it raises a exception, and I have it in a try except block and it does catch the exception, however it then raises again in the SFTP components error event and then it skips the Try finally in my code.
I am using the version from June 2010 and the SFTP and all SSH client are all using blocking mode.

Is there a way to suppress the errors going to the error event? I want to handle my own errors with try except blocks.

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Post by snorkel » Tue 14 Dec 2010 17:45

ok, I found this in the help file:
Fail - if the NonBlocking property is False, then set the Fail parameter to False to prevent raising an exception, and set this parameter to True to raise the EScSFTPError exception. if the NonBlocking property is True, this parameter is ignored.


I have this in the sftp onerror event:

if operation = tscsftpOperation.opOpeningDir then
fail:=false;

and the exception is still being raised in the event causing the try finally to be skipped.

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Post by snorkel » Tue 14 Dec 2010 19:17

Nevermind on this one, It was a issue in the try finally, which was raising it twice and unhandled. All working fine now.

Post Reply