Skip to content

Commit

Permalink
Use ActionController::Base.logger to report template compilation erro…
Browse files Browse the repository at this point in the history
…rs since there is no AV::Base.logger
  • Loading branch information
jeremy committed Jul 9, 2008
1 parent 4354aa3 commit 7dc1047
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions actionpack/lib/action_view/template_handlers/compilable.rb
Expand Up @@ -37,10 +37,10 @@ def #{template.method}(local_assigns)
file_name = template.filename || 'compiled-template'
ActionView::Base::CompiledTemplates.module_eval(source, file_name, 0)
rescue Exception => e # errors from template code
if Base.logger
Base.logger.debug "ERROR: compiling #{template.method} RAISED #{e}"
Base.logger.debug "Function body: #{source}"
Base.logger.debug "Backtrace: #{e.backtrace.join("\n")}"
if logger = ActionController::Base.logger
logger.debug "ERROR: compiling #{template.method} RAISED #{e}"
logger.debug "Function body: #{source}"
logger.debug "Backtrace: #{e.backtrace.join("\n")}"
end

raise ActionView::TemplateError.new(template, @view.assigns, e)
Expand Down

0 comments on commit 7dc1047

Please sign in to comment.