Skip to content

Commit

Permalink
Removed deprecated #original_exception in `ActionView::Template::Er…
Browse files Browse the repository at this point in the history
…ror`.
  • Loading branch information
rafaelfranca committed Oct 10, 2016
1 parent a50cd3e commit b9ba263
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 4 additions & 0 deletions actionview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Removed deprecated `#original_exception` in `ActionView::Template::Error`.

*Rafael Mendonça França*

* Render now accepts any keys for locals, including reserved words

Only locals with valid variable names get set directly. Others
Expand Down
12 changes: 1 addition & 11 deletions actionview/lib/action_view/template/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,13 @@ class Error < ActionViewError #:nodoc:
# Override to prevent #cause resetting during re-raise.
attr_reader :cause

def initialize(template, original_exception = nil)
if original_exception
ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \
"Exceptions will automatically capture the original exception.", caller)
end

def initialize(template)
super($!.message)
set_backtrace($!.backtrace)
@cause = $!
@template, @sub_templates = template, nil
end

def original_exception
ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller)
cause
end

def file_name
@template.identifier
end
Expand Down

0 comments on commit b9ba263

Please sign in to comment.