class ActionView::StreamingTemplateRenderer::Body
:nodoc:
rendering the template.
It is initialized with a block that, when called, starts
A valid Rack::Body (i.e. it responds to each).
:nodoc:
* Rack::Cache needs to support streaming bodies
* Integrate exceptions with exceptron
* Support streaming from child templates, partials and so on.
== TODO
def each(&block)
def each(&block) begin @start.call(block) rescue Exception => exception log_error(exception) block.call ActionView::Base.streaming_completion_on_exception end self end
def initialize(&start)
rendering the template.
It is initialized with a block that, when called, starts
A valid Rack::Body (i.e. it responds to each).
:nodoc:
* Rack::Cache needs to support streaming bodies
* Integrate exceptions with exceptron
* Support streaming from child templates, partials and so on.
== TODO
def initialize(&start) @start = start end
def log_error(exception) #:nodoc:
TODO Once "exceptron" is in, refactor this piece to simply re-use exceptron.
This is the same logging logic as in ShowExceptions middleware.
def log_error(exception) #:nodoc: logger = ActionController::Base.logger return unless logger message = "\n#{exception.class} (#{exception.message}):\n" message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code) message << " " << exception.backtrace.join("\n ") logger.fatal("#{message}\n\n") end