diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/template_error.rb | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index fa9f9ed09d..38010a7434 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed error rendering of rxml documents to not just swallow the exception and return 0 (still not guessing the right line, but hey) + * Fixed that textilize and markdown would instantiate their engines even on empty strings. This also fixes #333 [Ulysses] * Added use of *_before_type_cast for all input and text fields. This is helpful for getting "100,000" back on a integer-based diff --git a/actionpack/lib/action_view/template_error.rb b/actionpack/lib/action_view/template_error.rb index 0ac8ee4c37..5fa7f2db5e 100644 --- a/actionpack/lib/action_view/template_error.rb +++ b/actionpack/lib/action_view/template_error.rb @@ -49,14 +49,13 @@ module ActionView end def line_number - begin - @original_exception.backtrace.join.scan(/\((?:erb)\):([0-9]*)/).first.first.to_i - rescue - begin - original_exception.message.scan(/\((?:eval)\):([0-9]*)/).first.first.to_i - rescue - 1 - end + trace = @original_exception.backtrace.join + if trace.include?("erb):") + trace.scan(/\((?:erb)\):([0-9]*)/).first.first.to_i + elsif trace.include?("eval):") + trace.scan(/\((?:eval)\):([0-9]*)/).first.first.to_i + else + 1 end end |