lib/hanami/rendering_policy.rb in hanami-1.3.4 vs lib/hanami/rendering_policy.rb in hanami-1.3.5

- old
+ new

@@ -1,8 +1,9 @@ require 'hanami/utils/class' require 'hanami/views/default' require 'hanami/views/null_view' +require 'hanami/action/rack/errors' module Hanami # Rendering policy # # @since 0.1.0 @@ -15,12 +16,10 @@ # @api private BODY = 2 # @api private HANAMI_ACTION = 'hanami.action'.freeze - # @api private - RACK_EXCEPTION = 'rack.exception'.freeze # @api private SUCCESSFUL_STATUSES = (200..201).freeze # @api private RENDERABLE_FORMATS = [:all, :html].freeze @@ -55,10 +54,10 @@ begin view_for(action, response).render( action.exposures ) rescue StandardError => e - env[RACK_EXCEPTION] = e + Hanami::Action::Rack::Errors.set(env, e) raise e unless @configuration.handle_exceptions response[STATUS] = ERROR_STATUS false end