hello guys
how to catch exceptions in RoR like java?
in java
try{
}
catch(Exception c)
{}
how to do that in RoR??
thanks
hello guys
how to catch exceptions in RoR like java?
in java
try{
}
catch(Exception c)
{}
how to do that in RoR??
thanks
Look up the Ruby documentation for begin/rescue
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 # -> }
thanks guys, it works successfully (Y)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs