Sha256: e0e6783ebd41558076495cd40a9305e618d05416487094701992fec4cf46883f

Contents?: true

Size: 747 Bytes

Versions: 12

Compression:

Stored size: 747 Bytes

Contents

module EventSourcery
  module EventProcessing
    module ErrorHandlers
      module ErrorHandler
        # The default with_error_handling method. Will always raise NotImplementedError
        #
        # @raise [NotImplementedError]
        def with_error_handling
          raise NotImplementedError, 'Please implement #with_error_handling method'
        end

        private

        def report_error(error)
          error = error.cause if error.instance_of?(EventSourcery::EventProcessingError)
          EventSourcery.logger.error("Processor #{@processor_name} died with #{error}.\n#{error.backtrace.join("\n")}")

          EventSourcery.config.on_event_processor_error.call(error, @processor_name)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
event_sourcery-1.0.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.24.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.23.1 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.23.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.22.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.21.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.20.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.19.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.18.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.17.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.16.1 lib/event_sourcery/event_processing/error_handlers/error_handler.rb
event_sourcery-0.15.0 lib/event_sourcery/event_processing/error_handlers/error_handler.rb