[MacRuby] #1399: Rake exceptions always print a full trace
MacRuby
ruby-noreply at macosforge.org
Tue Oct 4 06:41:31 PDT 2011
#1399: Rake exceptions always print a full trace
--------------------------------+-------------------------------------------
Reporter: joshaber@… | Owner: lsansonetti@…
Type: defect | Status: closed
Priority: major | Milestone:
Component: MacRuby | Resolution: invalid
Keywords: |
--------------------------------+-------------------------------------------
Changes (by watson1978@…):
* status: new => closed
* resolution: => invalid
Comment:
CRuby19 p290's rake (version 0.8.7) always display trace logs as well the
MacRuby in my environment.
{{{
$ cat test_rake.rake
task :blah do
raise Exception, 'whatev'
end
$ rake19 --version
rake, version 0.8.7
$ rake19 -f test_rake.rake
(in /Users/watson/tmp)
rake aborted!
Don't know how to build task 'default'
/usr/local/lib/ruby/1.9.1/rake.rb:1720:in `[]'
/usr/local/lib/ruby/1.9.1/rake.rb:2040:in `invoke_task'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/local/bin/rake19:31:in `<main>'
}}}
To hide the traces, I think the following changes are required. Or, update
macrake to 0.9.2.
{{{
diff --git a/lib/rake.rb b/lib/rake.rb
index 36ca077..52d9ef7 100755
--- a/lib/rake.rb
+++ b/lib/rake.rb
@@ -2067,7 +2067,7 @@ module Rake
# Exit with error message
$stderr.puts "#{name} aborted!"
$stderr.puts ex.message
- if options.trace or true
+ if options.trace
$stderr.puts ex.backtrace.join("\n")
else
$stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ }
|| ""
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/1399#comment:4>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list