Thursday, June 26, 2008

rescue




rescuing exceptions in Ruby.

What I needed was to find out what exception was being thrown, I did this with:


begin
raise 'A test exception.'
rescue Exception => e
puts e.message
puts e.backtrace.inspect
end