How can I find Error Codes and explanations

0 votes
asked Jun 13, 2016 by ozgunkus (120 points)

Hi,

We use rebex FTP SSL and SFTP for .NET 2.0 . I need error message list and explanations . I dont find in site . How can I find all error list and explanations ? could you help me please ?

2 Answers

0 votes
answered Jun 13, 2016 by Lukas Matyska (38,400 points)

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:
1) ArgumentException, InvalidOperationException and ObjectDisposedException -
These exceptions are thrown where one would expect it.
2) 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.
3) 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.

commented Jun 14, 2016 by ozgunkus (120 points)
Hi ,

Firstly thank you for your answer . Could you send me , common error message list ? for example Error 10 etc
commented Jun 14, 2016 by Lukas Pokorny (85,170 points)
I added a new answer with links to error lists for common FTP and SFTP errors.
0 votes
answered Jun 14, 2016 by Lukas Pokorny (85,170 points)

For FTP error lists and descriptions, see FtpException object's Status and Response properties. Also, check out RFC 959 for FTP error code descriptions (accessible through Response property's Code property).

For SFTP error lists and descriptions, see SftpException object's Status and Code properties. For description of the error codes, see SFTP protocol specification.

In both Rebex FTP/SSL and SFTP, exception status of ProtocolError indicates an error at the protocol level reported by the server. In this case, a server is free to provide an error message of its own. This then becomes part of Rebex exception message, which makes maintaining an "error list" infeasible. In general, relying on exception messages is strongly discouraged - use the status codes instead.

...