diff options
author | Nathan Weizenbaum <nex342@gmail.com> | 2008-05-01 13:27:21 -0700 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-02 10:28:53 +0100 |
commit | b88a6dbc39fcaa12dc58d06d4222f2443f02a32a (patch) | |
tree | b95c789ef16ddf3b6bf1f9a767fe41f027a91908 /actionpack/lib/action_view/base.rb | |
parent | f6ec296ad84ac7e321980cfdd8bba2ea6ce3a14b (diff) | |
download | rails-b88a6dbc39fcaa12dc58d06d4222f2443f02a32a.tar.gz rails-b88a6dbc39fcaa12dc58d06d4222f2443f02a32a.tar.bz2 rails-b88a6dbc39fcaa12dc58d06d4222f2443f02a32a.zip |
Capture view errors in ActionView::Template.
This means that errors raised by partials are caught by ActionView::PartialTemplate,
which in turn means they have the proper filename and line number information.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 4ed20fec89..bfd1a0ee0d 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -244,16 +244,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn template = Template.new(self, template_path, use_full_path, local_assigns) - begin - render_template(template) - rescue Exception => e - if TemplateError === e - e.sub_template_of(template.filename) - raise e - else - raise TemplateError.new(template, @assigns, e) - end - end + render_template(template) end # Renders the template present at <tt>template_path</tt> (relative to the view_paths array). @@ -290,7 +281,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn end def render_template(template) #:nodoc: - template.render + template.render_template end # Returns true is the file may be rendered implicitly. |