Sha256: f66bc9d249606bd683bb85456f66f490d08b728cd88c74d801b75ea6db266719

Contents?: true

Size: 364 Bytes

Versions: 39

Compression:

Stored size: 364 Bytes

Contents

module Locomotive
  module Middlewares

    class CustomPublicExceptions < ActionDispatch::PublicExceptions

      def call(env)
        status = env['PATH_INFO'][1..-1]

        if status == '404' || status == '500'
          Locomotive::ErrorsController.action(:"error_#{status}").call(env)
        else
          super
        end
      end

    end

  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.2.0.alpha1 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.1.1 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.1.0 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.1.0.rc1 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.3 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.2 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.1 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.0 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.0.rc0 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.0.alpha3 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.4.1 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.0.alpha2 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-4.0.0.alpha1 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.4.0 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.3.0 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.3.0.rc3 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.3.0.rc2 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.1.2 lib/locomotive/middlewares/custom_public_exceptions.rb
locomotivecms-3.2.1 lib/locomotive/middlewares/custom_public_exceptions.rb