charliesome/better_errors — pull request #13 by caldwell (2012-12-09 22:20:24+00:00)
Title: Fix weird issue where data in the backtrace is bogus

Ruby appears to send backtraces with bad line numbers (IE, a larger number
than the number of lines in the file) in certain cases.

For instance one of the lines in my backtrace is this:

/lib/ruby/gems/1.9.1/gems/http_router-0.10.2/lib/http_router/node/root.rb:156:in `[]'

However, [http_router/node/root.rb](https://github.com/joshbuddy/http_router/blob/master/lib/http_router/node/root.rb) only has 141 lines.

This patch adds a check so that the better_errors code doesn't itself raise an uncaught exception when this occurs.

-David