# Catch exception

**URL:** <https://discuss.rubyonrails.org/t/catch-exception/16403>\
**Category:** rubyonrails-talk\
**Created:** [July 31, 2007, 11:55am UTC](https://discuss.rubyonrails.org/t/catch-exception/16403 "2007-07-31T11:55:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Villegas](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Luis\_Villegas](https://discuss.rubyonrails.org/u/Luis_Villegas)\
**Post date:** [July 31, 2007, 11:55am UTC](https://discuss.rubyonrails.org/t/catch-exception/16403/1 "2007-07-31T11:55:29Z")

</div>

This is with java traduction (don’t know if it’s ok the java part 😉 )

begin # → try{ raise “exception” # → throw new Exception(); rescue # → }catch(Exception e){ puts $! # → System.out.println(e.toString()); end # → }
