Changeset 34173 in webkit
- Timestamp:
- May 28, 2008 8:46:18 AM (16 years ago)
- Location:
- trunk/BugsSite
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BugsSite/ChangeLog
r32601 r34173 1 2008-05-28 Adam Roben <aroben@apple.com> 2 3 Print exceptions from PrettyPatch to stdout 4 5 This will make it much easier to debug problems with PrettyPatch, 6 since we'll be able to see the exceptions in the browser. 7 8 Reviewed by Sam Weinig. 9 10 * PrettyPatch/prettify.rb: Added a --html-exceptions option, which 11 will print exceptions to stdout as HTML. 12 * attachment.cgi: Changed to pass --html-exceptions to prettify.rb. 13 1 14 2008-04-26 David Kilzer <ddkilzer@apple.com> 2 15 -
trunk/BugsSite/PrettyPatch/prettify.rb
r30048 r34173 2 2 3 3 require 'PrettyPatch' 4 require 'optparse' 5 require 'webrick/htmlutils' 6 7 BACKTRACE_SEPARATOR = "\n\tfrom " 8 9 options = { :html_exceptions => false } 10 OptionParser.new do |opts| 11 opts.banner = "Usage: #{File.basename($0)} [options] [patch-file]" 12 13 opts.separator "" 14 15 opts.on("--html-exceptions", "Print exceptions to stdout as HTML") { |h| options[:html_exceptions] = h } 16 end.parse! 4 17 5 18 patch_data = nil … … 10 23 end 11 24 12 puts PrettyPatch.prettify(patch_data) 25 begin 26 puts PrettyPatch.prettify(patch_data) 27 rescue => exception 28 raise unless options[:html_exceptions] 29 30 backtrace = exception.backtrace 31 backtrace[0] += ": " + exception + " (" + exception.class.to_s + ")" 32 print "<pre>\n", WEBrick::HTMLUtils::escape(backtrace.join(BACKTRACE_SEPARATOR)), "\n</pre>\n" 33 end -
trunk/BugsSite/attachment.cgi
r30048 r34173 734 734 -expires => '+3M'); 735 735 736 open2(\*OUT, \*IN, "/usr/bin/ruby", "-I", "PrettyPatch", "PrettyPatch/prettify.rb" );736 open2(\*OUT, \*IN, "/usr/bin/ruby", "-I", "PrettyPatch", "PrettyPatch/prettify.rb", "--html-exceptions"); 737 737 print IN $thedata . "\n"; 738 738 close(IN);
Note: See TracChangeset
for help on using the changeset viewer.