Sha256: 810b4cff2b8e25ad22a948431062a5cc1f9a987b3b5ac59bd61763b3832a883f

Contents?: true

Size: 692 Bytes

Versions: 24

Compression:

Stored size: 692 Bytes

Contents

module Alchemy
  module Middleware
    class RescueOldCookies
      def initialize(app)
        @app = app
      end

      def call(env)
        begin
          @app.call(env)
        rescue NameError => error
          if error.to_s =~ /uninitialized constant Alchemy::Clipboard/
            message = "<h2>You have an old style Alchemy clipboard in your session!</h2>"
            message += "<h3>Please remove your cookies and try again.</h3>"
            Rails.logger.error(error)
            return [
              500, { "Content-Type" => "text/html" },
              [message]
            ]
          else
            raise error
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
alchemy_cms-3.2.1 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.3 lib/alchemy/middleware/rescue_old_cookies.rb
lc_alchemy_cms-3.2.1 lib/alchemy/middleware/rescue_old_cookies.rb
lc_alchemy_cms-3.2.0 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.2.0 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.2.0.rc1 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.2.0.beta lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.1 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.0.4 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.rc3 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.rc2 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.rc1 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.beta6 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.beta5 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.beta4 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.0.3 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.beta3 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.beta2 lib/alchemy/middleware/rescue_old_cookies.rb
alchemy_cms-3.1.0.beta1 lib/alchemy/middleware/rescue_old_cookies.rb