mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Try to give nicer error messages on internal failures
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9c40644850
commit
e78a9cdcdb
1 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue