Unfortunately, .NET does not have enforced (checked) exceptions like Java, which makes exception documentation hard. We tried to do it in Rebex ZIP component, however we found out that it's far from perfect (e.g. we have to do it all manually and the correctness cannot be tested anyway).
We realized that almost all Rebex APIs have 3 kinds of exceptions:
ArgumentException, InvalidOperationException and ObjectDisposedException -
These exceptions are thrown where one would expect it.
Component related exceptions such as SftpException for SFTP, ZipException for ZIP, FtpException for FTP, etc. -
These exceptions covers all exceptional states of the operations, all have the Status property (or ProblemType for ZIP) which describes the exception.
IOException, UnauthorizedAccessException, PathTooLongException, SecurityException –
These exceptions are thrown if the method works with the file system somehow (this can be also determined intuitively by user from the method behavior).
Other than this, no other exceptions should be thrown by Rebex SFTP and FTP/SSL (the low level API on Rebex.Common assembly might use other exceptions such as CertificateException or CryptographicException).
We would like to improve exception documentation in future. We are thinking about some kind of “automated” generation. We would like to also write an article kind of “Handling Rebex SFTP exception” describing in detail what kinds of exceptions are thrown by what kinds of calls. That would make it possible to quickly write a set of several general-purpose try/catch blocks for different categories of API calls.