Sha256: f50e504ba4d130ac60703d01627accc9df777d14b7fa6b41c451d3c66b0da8c3

Contents?: true

Size: 897 Bytes

Versions: 9

Compression:

Stored size: 897 Bytes

Contents

module DaemonKit
  module ErrorHandlers
    # Error handlers in DaemonKit are used by the #Safety class. Any
    # error handler has to support the interface provided by this
    # class. It's also required that safety handlers implement a
    # singleton approach (handled by default by #Base).
    class Base

      class << self

        @instance = nil

        def instance
          @instance ||= new
        end
        private :new

        # When we're inherited, immediately register the handler with
        # the safety net
        def inherited( child ) #:nodoc:
          Safety.register_error_handler( child )
        end
      end

      # Error handlers should overwrite this method and implement
      # their own reporting method.
      def handle_exception( exception )
        raise NoMethodError, "Error handler doesn't support #handle_exception"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
amqp-daemon-kit-1.0.1 lib/daemon_kit/error_handlers/base.rb
amqp-daemon-kit-0.1.8.2 lib/daemon_kit/error_handlers/base.rb
amqp-daemon-kit-0.1.8.1 lib/daemon_kit/error_handlers/base.rb
daemon-kit-0.1.8.1 lib/daemon_kit/error_handlers/base.rb
daemon-kit-0.1.8 lib/daemon_kit/error_handlers/base.rb
daemon-kit-0.1.8rc3 lib/daemon_kit/error_handlers/base.rb
textgoeshere-daemon-kit-0.1.8.31 lib/daemon_kit/error_handlers/base.rb
textgoeshere-daemon-kit-0.1.8rc3 lib/daemon_kit/error_handlers/base.rb
daemon-kit-0.1.8rc2 lib/daemon_kit/error_handlers/base.rb