Discuss this help topic in SecureBlackbox Forum
SFTP: Handle SFTP errors
In TElSimpleSFTPClient component and in additional edition-specific components SSH errors are reported using OnError event. If SFTP error occurs, EElSFTPError exception is thrown.
You can use LastSyncComment property to get human-readable description of the error.
In TElSftpClient and TElSftpServer components SFTP errors are reported using OnError event. SSH error handling is described in the corresponding how-to article.
The error codes are described in documentation. Note, that the event reports only the errors of SFTP and SSH protocols, and not underlying socket errors.
To handle socket events, as well as unexpected internal errors which don't fall to SSH/SFTP category, wrap the calls to SFTP methods with appropriate exception handling statements (try/catch in C++ and C#, try/except in Delphi etc).