0 votes
by (220 points)

1 Answer

0 votes
by (75.8k points)

by (220 points)
As you said from SFTP client class we will always throw only SFTPException. Is this true even if we use FileTransferClient class for Sftp operations?

Similarly if we make FTP connections using FileTransferClient class will we always get only FtpException having SocketException (or any other exception) in InnerException property?

If above statements are true and we have SocketException in InnerException property then will eFTP.Status == FtpExceptionStatus.ProtocolError and eSFTP.Status == FtpExceptionStatus.ProtocolError be true or false?
by (75.8k points)
Yes, in FileTransferClient class you will always get SftpException when using SFTP protocol, and FtpException when using FTP protocol.

No, Status == ProtocolError will be set only in cases a protocol error appears e.g. "File not found" or "Access denied" etc.
For socket exceptions you should get Status == SocketError.
...