I have some function
def func()
val = 0 / 0
end
func()
…
some code
…
=> error
how to specify the functions do not show the error and continued
implementation of the program?
I have some function
def func()
val = 0 / 0
end
func()
…
some code
…
=> error
how to specify the functions do not show the error and continued
implementation of the program?
On Sat, Aug 2, 2008 at 10:50 AM, Andy [email protected] wrote:
I have some function
def func()
val = 0 / 0
endhow to specify the functions do not show the error and continued
implementation of the program?
Rescue it.
val = 0 / 0 rescue 0
or
val = 0 / 0 rescue nil
–
Greg D.
http://destiney.com/
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