Module: Pakyow::Application::Behavior::Presenter::ErrorRendering

Extended by:
Support::Extension
Defined in:
lib/pakyow/application/behavior/presenter/error_rendering.rb

Class Method Summary collapse

Class Method Details

.render_error(error, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/pakyow/application/behavior/presenter/error_rendering.rb', line 20

def self.render_error(error, context)
  context.respond_to :html do
    if Pakyow.env?(:production)
      context.render "/500"
    else
      unless error.is_a?(Pakyow::Error)
        error = Pakyow::Error.build(error)
      end

      error.extend Support::Bindable
      context.expose :pw_error, error
      context.render "/development/500"
    end
  end
end