Forum: Ruby on Rails Getting the stack trace

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Naga harish K. (Guest)
on 2007-03-15 11:50
Hi all,
 I am using the following code to print the exception, but is there a
way to get the stack trace of the complete error like

Exception: No option with text of Contract form in this select element
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3656:in
`select_item_in_select_list'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3621:in
`select'
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `run'
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:in
`run_suite'
C:/Backup/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:107:in
`start_mediator'
C:/Backup/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:52:in
`start'
C:/Backup/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:272




begin
.....
..
rescue Exception => e
puts e.to_s
end



so for my above code my output is "No option with text of Contract form
in this select element"
but i want the whole error trace, So how i could use the code in ruby
for this??
Michael W. (Guest)
on 2007-03-16 05:34
(Received via mailing list)
Naga harish Kanegolla wrote:
> C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
>
>
>
> so for my above code my output is "No option with text of Contract form
> in this select element"
> but i want the whole error trace, So how i could use the code in ruby
> for this??
>

rescue Exception => e
   puts e.to_s
   puts e.backtrace.join("\n")
end


--
Michael W.
This topic is locked and can not be replied to.