Exception Handling

Hello,

I have a basic idea of what an exception is but I am not able to
understand it so that I can make use of it in my application's.
If possible please try and help me out with the basic of exception and
its use.

It would also be great, if any one of you could give me certain links on
exceptions which would help me understand its concepts better.

Thank You

···

--
Posted via http://www.ruby-forum.com/.

Basically an exception signals a situation that cannot be dealt with
in the normal flow of operation (e.g. you are reading from a file and
the disk fails or the current method received invalid parameters).
Exceptions should not be abused for normal flow control (e.g. exiting
a loop).

Beyond those commonplaces it starts to get wiggly. There are many
people who have different opinions about what is an exception and what
not and I have seen heated debates about individual cases. One
general rule of thumb could be: if you find yourself returning a flag
indicating success or failure of a method then chances are that you
might rather want an exception for the failure case. As always, take
this with a grain of salt. :slight_smile:

Kind regards

robert

···

2007/9/10, Advait Bellur <advait.bellur@yahoo.co.in>:

I have a basic idea of what an exception is but I am not able to
understand it so that I can make use of it in my application's.
If possible please try and help me out with the basic of exception and
its use.

It would also be great, if any one of you could give me certain links on
exceptions which would help me understand its concepts better.

The de facto bible of Ruby:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html

Enjoy :slight_smile:
FireAphis

···

On Sep 10, 8:08 am, Advait Bellur <advait.bel...@yahoo.co.in> wrote:

Hello,

I have a basic idea of what an exception is but I am not able to
understand it so that I can make use of it in my application's.
If possible please try and help me out with the basic of exception and
its use.

It would also be great, if any one of you could give me certain links on
exceptions which would help me understand its concepts better.

Thank You
--
Posted viahttp://www.ruby-forum.com/.

Hi,

... And you'll find many other links in this wikipedia page :