Sha256: 8a8ad358669cbc2a21009c876869f261302573bbf0df27e32aeca237421b6ade

Contents?: true

Size: 535 Bytes

Versions: 3

Compression:

Stored size: 535 Bytes

Contents

# encoding: utf-8
module LocalPac
  module Actions
    class HandleError

      private

      attr_reader :exception, :original_message, :handler_klass

      public

      def initialize(exception, handler_klass = ErrorHandler)
        @exception        = exception.class
        @original_message = exception.message
        @handler_klass    = handler_klass
      end

      def run
        handler = handler_klass.find exception
        handler.original_message = original_message

        handler.run
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
local_pac-0.6.3 lib/local_pac/actions/handle_error.rb
local_pac-0.6.2 lib/local_pac/actions/handle_error.rb
local_pac-0.6.1 lib/local_pac/actions/handle_error.rb