EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Exceptions vs. OnError

Posted: 03/21/2013 13:11:24
by Michael Lovett (Standard support level)
Joined: 03/20/2013
Posts: 28

Hi there

Are there cases in which important errors are only reported via OnError (and no exception is thrown for them)?

In a current app I'm working on, it's actually more convenient for me to do try/catch handling than have an OnError handler, but I want to know if I skip having an OnError handler if I could possibly "miss" some error cases?

The online docs are a little vague on this topic..

Posted: 03/21/2013 13:15:20
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

Could you clarify what exact classes do you use.
Posted: 03/21/2013 13:18:49
by Eugene Mayevski (Team)

OnError report protocol errors. Vast majority of such errors leads to premature disconnection. You will get an exception in this case. So you can handle OnError for logging purposes (this is recommended) and catch exceptions to properly handle error situations.

Sincerely yours
Eugene Mayevski
Posted: 03/21/2013 13:24:04
by Michael Lovett (Standard support level)
Joined: 03/20/2013
Posts: 28

I'm referring to SimpleFTP and SimpleSSH clients.

I think this is what I'm hearing you say: any situation that prevents the normal operation of one of these classes (ie, prevents connecting, prevents sending or receiving data, etc) will result in an exception being thrown and I can safely "ignore" OnError in these cases..

Is that right?
Posted: 03/21/2013 13:26:09
by Eugene Mayevski (Team)

Yes, I can't remember a situation when OnError was fired and connection or data flow continued without exception.

Sincerely yours
Eugene Mayevski



Topic viewed 589 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!