lib/event_sourcery/errors.rb in event_sourcery-0.14.0 vs lib/event_sourcery/errors.rb in event_sourcery-0.15.0

- old
+ new

@@ -4,16 +4,21 @@ UnableToProcessEventError = Class.new(Error) ConcurrencyError = Class.new(Error) AtomicWriteToMultipleAggregatesNotSupported = Class.new(Error) class EventProcessingError < Error - attr_reader :event + attr_reader :event, :processor - def initialize(event) + def initialize(event:, processor:) @event = event + @processor = processor end def message - cause.message if cause + 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 end end