From: james.d.masters@... Date: 2007-04-24T12:45:06+09:00 Subject: Re: exception and $! On Apr 23, 8:29 pm, Paul Rogers wrote: > > > Thanks, I actually wanted to see what the last exception was out side > > > of a block, kind of like this > > > begin > > > raise "bad" > > > rescue => e > > > puts "#{e} was raised" > > > end > > > puts "Just to make sure, last exception was #{$!}" If you don't have your heart set on using $!, then just put the contents into a variable (code not tested): last_error = nil begin raise "bad" rescue => e last_error = e end puts "An error was encountered: #{e}" if e