Project

General

Profile

Feature #12623

Updated by nobu (Nobuyoshi Nakada) about 4 years ago

Hi there! 

 There's pretty nice feature that we can use "short rescue" in method definitions:  

 ~~~ruby ~~~ 
 def my_method 
   raise '1234' 
 rescue 
    puts 'rescued' 
 end 
 ~~~ 

 What about using this in blocks? 

 ~~~ruby ~~~ 
 loop do 
   n = enumerator.next 
   # do something 
 rescue StopIteration 
 end 
 ~~~ 

 P.S. actually I am not sure if this FR was not created earlier but I couldn't google it. 
 P.P.S sorry for my english

Back