# Rescue

**URL:** <https://www.ruby-forum.com/t/rescue/191498>\
**Category:** Ruby\
**Created:** [July 13, 2010, 2:30pm UTC](https://www.ruby-forum.com/t/rescue/191498 "2010-07-13T14:30:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swengineer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Post date:** [July 13, 2010, 2:30pm UTC](https://www.ruby-forum.com/t/rescue/191498/1 "2010-07-13T14:30:03Z")

</div>

In this code: [http://pastie.org/private/llneqf8bi5kf3i82q2ivw](http://pastie.org/private/llneqf8bi5kf3i82q2ivw) from  
[Learn How to Blog and Build Websites for Profit!](http://rubylearning.com/satishtalim/ruby_exceptions.html), I really  
didn’t get the idea of “rescue” and what it is supposed to do?

Can you just explain it further?

Thanks.

---

<div class="post-metadata">

**Author:** ![swengineer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Post date:** [July 13, 2010, 2:36pm UTC](https://www.ruby-forum.com/t/rescue/191498/2 "2010-07-13T14:36:01Z")

</div>

If you are familiar to other programming languages such as Java, rescue  
is  
similar to ‘catch’.  
Basically literally speaking, it rescues you in case there is an  
exception  
and catches the exception and gives you the chance to do something about  
it  
a bit more gracefully compared to the vm. I hope that made it a bit  
clear to  
you.

On Tue, Jul 13, 2010 at 18:00, Abder-Rahman A.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 

–

Thanks & Regards,  
Dhruva S…

---

<div class="post-metadata">

**Author:** ![swengineer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Post date:** [July 13, 2010, 2:39pm UTC](https://www.ruby-forum.com/t/rescue/191498/3 "2010-07-13T14:39:43Z")

</div>

Dhruva S. wrote:

> If you are familiar to other programming languages such as Java, rescue  
> is  
> similar to ‘catch’.  
> Basically literally speaking, it rescues you in case there is an  
> exception  
> and catches the exception and gives you the chance to do something about  
> it  
> a bit more gracefully compared to the vm. I hope that made it a bit  
> clear to  
> you.
> 
> On Tue, Jul 13, 2010 at 18:00, Abder-Rahman A.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:
> 
> > 
> 
> –
> 
> Thanks & Regards,  
> Dhruva S…

Thanks a lot. Yes, now I get it. If it is like “catch” in Java which I’m  
aware it, that points it.
