From: Jan Roslind Date: 2010-02-11T17:18:26+09:00 Subject: Re: Global rescue - DRY (don't repeat yourself) Martin Boese wrote: .... > Hmm.. what about: > > > class Code > def self.try(&block) > begin > block.call > rescue > puts "Errors: #{$!}" > end > end > end > > > Code.try do > a = 1123 > bad_code > end Hi Martin. Thanks for your suggestion. It Works. But how do I access bindings (to find local variables) and self (to find instance variables) from Code.try method. Regards Jan -- Posted via http://www.ruby-forum.com/.