Joel Pearson wrote in post #1121289:
> Just use error handling properly.
>
> begin
> #standard code
> rescue

I am looking for the below operations,but only when error will be 
occured :

a = (1..10)
i=0
until a.size>10
 next i+=1 if i<5 # this should be done on Error
 p a[i]
 i+=1
end

If still I am not clear,please let me know the confusions.

until val == nil
  #line1
  #line2 #<~~ error can be generated here.If error happened I want to 
start
from #line1 again.skipping the below code.
  #line3
   ...
end

Thanks

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/e9b727c1156db8475164983661ed4523%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to