From: Joel Pearson Date: 2013-01-29T18:35:46+09:00 Subject: Re: question on watir It's probably best to put the errorhandler in the script which is using the class. Apparently it doesn't like rescuing inside a class like that. This approach works: irb(main):001:0> class Raj irb(main):002:1> def hello irb(main):003:2> puts 'hello' irb(main):004:2> 1/0 irb(main):005:2> end irb(main):006:1> def hi irb(main):007:2> puts 'hi' irb(main):008:2> end irb(main):009:1> irb(main):010:1* rescue Exception => e irb(main):011:1> puts 'the exception has been raised' irb(main):012:1> end => nil irb(main):013:0> begin irb(main):014:1* Raj.new.hello irb(main):015:1> rescue irb(main):016:1> puts 'the exception has been raised' irb(main):017:1> end hello the exception has been raised => nil -- Posted via http://www.ruby-forum.com/.