# Exception Handling

**URL:** <https://www.ruby-forum.com/t/exception-handling/196463>\
**Category:** Ruby\
**Created:** [September 10, 2007, 7:08am UTC](https://www.ruby-forum.com/t/exception-handling/196463 "2007-09-10T07:08:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![advait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@advait](https://www.ruby-forum.com/u/advait)\
**Post date:** [September 10, 2007, 7:08am UTC](https://www.ruby-forum.com/t/exception-handling/196463/1 "2007-09-10T07:08:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![advait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@advait](https://www.ruby-forum.com/u/advait)\
**Post date:** [September 10, 2007, 10:02am UTC](https://www.ruby-forum.com/t/exception-handling/196463/2 "2007-09-10T10:02:13Z")

</div>

2007/9/10, Advait B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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.

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. 🙂

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![advait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@advait](https://www.ruby-forum.com/u/advait)\
**Post date:** [September 10, 2007, 10:06am UTC](https://www.ruby-forum.com/t/exception-handling/196463/3 "2007-09-10T10:06:13Z")

</div>

On Sep 10, 8:08 am, Advait B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

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

The de facto bible of Ruby:  
[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut\_exceptions.html](http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html)

Enjoy 🙂  
FireAphis

---

<div class="post-metadata">

**Author:** ![advait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@advait](https://www.ruby-forum.com/u/advait)\
**Post date:** [September 10, 2007, 10:21am UTC](https://www.ruby-forum.com/t/exception-handling/196463/4 "2007-09-10T10:21:16Z")

</div>

Hi,

… And you’ll find many other links in this wikipedia page :

> **[Exception handling](https://en.wikipedia.org/wiki/Exception_handling)**
>
> In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing – during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented. Exception handling, if provided,...
