Catch exception

hello guys

how to catch exceptions in RoR like java?

in java
catch(Exception c)

how to do that in RoR??

Look up the Ruby documentation for begin/rescue :slight_smile:

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

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

good link:

thanks guys, it works successfully (Y)