From: Alan Chen Date: 2002-02-12T03:27:09+09:00 Subject: rescue syntax I know it's Does anyone else find themselves trying to abbreviate error handling code as follows? From: if( expr ) begin # do stuff rescue # oops end end To: if( expr ) # do stuff rescue # oops end Would the option of attaching rescue conditions to arbitrary code blocks be desireable? For methods, I'd imagine something like the following def method # method logic rescue # oops, bad logic end and maybe array.each do |e| # process e rescue # bad process end I haven't really thought through all the different constructs. In addition, I don't know how this might affect the clarity of code. I guess it could get somewhat obscured if code starts looking like: if # blah rescue # blah else # else logic rescue # else-rescue logic end What do other people think? -- alan -- Alan Chen Digikata LLC http://digikata.com