Class: EventSourcery::EventProcessingError

Inherits:
Error
  • Object
show all
Defined in:
lib/event_sourcery/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event:, processor:) ⇒ EventProcessingError



11
12
13
14
# File 'lib/event_sourcery/errors.rb', line 11

def initialize(event:, processor:)
  @event = event
  @processor = processor
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



9
10
11
# File 'lib/event_sourcery/errors.rb', line 9

def event
  @event
end

#processorObject (readonly)

Returns the value of attribute processor.



9
10
11
# File 'lib/event_sourcery/errors.rb', line 9

def processor
  @processor
end

Instance Method Details

#messageObject



16
17
18
19
20
21
22
# File 'lib/event_sourcery/errors.rb', line 16

def message
  parts = []
  parts << "#<#{processor.class} @@processor_name=#{processor.processor_name.inspect}>"
  parts << "#<#{event.class} @id=#{event.id.inspect}, @uuid=#{event.uuid.inspect}, @type=#{event.type.inspect}>"
  parts << "#<#{cause.class}: #{cause.message}>"
  parts.join("\n") + "\n"
end