Ben Johnson
2006-Aug-06 20:40 UTC
[Rails] Finding out what line number exceptions were raised?
If I rescue an exception and I do the following rescue Exception => e puts "The line number the exception was raised is...." end How do I complete that puts statement? Thanks for your help. -- Posted via http://www.ruby-forum.com/.
Ezra Zygmuntowicz
2006-Aug-06 21:40 UTC
[Rails] Finding out what line number exceptions were raised?
On Aug 6, 2006, at 1:40 PM, Ben Johnson wrote:> If I rescue an exception and I do the following > > rescue Exception => e > puts "The line number the exception was raised is...." > end > > How do I complete that puts statement? > > Thanks for your help. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsrescue Exception => e logger.error "#{ e.message } - (#{ e.class })" << "\n" << (e.backtrace or []).join("\n") end that will get you pretty much all the info you can get from an exception. -Ezra