Page 1 of 1

SFTP opendirectory exception issue/question

Posted: Tue 14 Dec 2010 17:30
by snorkel
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.

Posted: Tue 14 Dec 2010 17:45
by snorkel
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.

Posted: Tue 14 Dec 2010 19:17
by snorkel
Nevermind on this one, It was a issue in the try finally, which was raising it twice and unhandled. All working fine now.