Module: TemplateStreaming::ErrorRecovery::Controller::ClassMethods

Defined in:
lib/template_streaming/error_recovery.rb

Instance Method Summary collapse

Instance Method Details

#on_streaming_error(&block) ⇒ Object

Call the given block when an error occurs while streaming.

The block is called with the controller instance and exception object.

Hook in your exception notification system here.



150
151
152
# File 'lib/template_streaming/error_recovery.rb', line 150

def on_streaming_error(&block)
  streaming_error_callbacks << block
end

#render_streaming_errors_with(&block) ⇒ Object

Call the give block to render errors injected into the page, when uncaught exceptions are raised while streaming.

The block is called with the view instance an list of exception objects. It should return the HTML to inject into the page.



161
162
163
# File 'lib/template_streaming/error_recovery.rb', line 161

def render_streaming_errors_with(&block)
  self.streaming_error_renderer = block
end