From: Jan Svitok Date: 2006-08-19T05:01:52+09:00 Subject: Re: exception handling in ruby On 8/18/06, Junkone wrote: > HI > My exception handling routine is not able to thro the stack trace etc > of the exception . > for eg. > rescue Exception > puts $_ > I get a nil in $_ > > However when i dont handle the exception, i get the nice exception > message > Watir::Exception::UnknownObjectException: Unable to locate object, > using id and > > How do i capture the exception details? > Regards > > Seede either use $! and $@, or write it more explicitly: ... rescue Exception ex puts ex.mesage puts ex.backtrace.join("\n") end