diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-04 15:10:38 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-04 15:10:38 +0000 |
commit | a61d392b45488b30e790c919c6b1ba1692dd5720 (patch) | |
tree | 112c370605c1bf167c2008ed56c5be990802b668 /lib/rdoc/parsers | |
parent | 23209559cf679ba188a3bef539880d3ac2ffc39b (diff) | |
download | ruby-a61d392b45488b30e790c919c6b1ba1692dd5720.tar.gz ruby-a61d392b45488b30e790c919c6b1ba1692dd5720.tar.xz ruby-a61d392b45488b30e790c919c6b1ba1692dd5720.zip |
Try to give nicer error messages on internal failures
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parsers')
-rw-r--r-- | lib/rdoc/parsers/parse_rb.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index 43c9d2657..bd3b1ec4d 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -1393,7 +1393,23 @@ module RDoc @unget_read = [] @read = [] catch(:eof) do - parse_statements(@top_level) + begin + parse_statements(@top_level) + rescue Exception => e + $stderr.puts "\n\n" + $stderr.puts "RDoc failure in #@input_file_name at or around " + + "line #{@scanner.line_no} column #{@scanner.char_no}" + $stderr.puts + $stderr.puts "Before reporting this, could you check that the file" + $stderr.puts "you're documenting compiles cleanly--RDoc is not a" + $stderr.puts "full Ruby parser, and gets confused easily if fed" + $stderr.puts "invalid programs." + $stderr.puts + $stderr.puts "The internal error was:\n\n" + + e.set_backtrace(e.backtrace[0,4]) + raise + end end @top_level end |