Can you add to documentation a specification about exceptions, that methods in your API can throw?

Your exceptions, like SftpException, SshException, ProxySocketException, does not have an one base (like "RebexException") class and this is OK, but writing code is hard: when unknown, what kind of exceptions can be thrown.

asked 28 Jul '10, 13:55

_FRED_'s gravatar image

_FRED_
907
accept rate: 0%

edited 10 Aug '10, 13:56

Rebex%20KB's gravatar image

Rebex KB ♦♦
256312


We do plan to document this in one of the next releases, we are aware that a clear specification would be very helpful.

Anyway, in Rebex SFTP, when working with the main Sftp class, you can generally catch SftpException only - SshExceptions and ProxySocketExceptions should be re-thrown as SftpException with an appropriate Status and an InnerException set to the original exception.

Other than that, methods and properties of all classes can throw ArgumentException and InvalidOperation, but these usually indicate that something is wrong with your code (or our code) and should not be handled unless for logging or error reporting purposes.

The SshPrivateKey class methods might throw CryptographicException when a cryptography-related error occurs.

link

answered 29 Jul '10, 12:49

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

Thanks, exceptions really wrapped and this is good. This is my mistake: I was not careful. I thought that when working with Sftp, the ProxySocketException can be handled.

(29 Jul '10, 13:25) _FRED_
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×18
×2

Asked: 28 Jul '10, 13:55

Seen: 328 times

Last updated: 10 Aug '10, 13:56