Sha256: c52904c68c279c1eb71314d257ee8a301cb7e0eca97867efd804d3ae87163c80
Contents?: true
Size: 1004 Bytes
Versions: 2
Compression:
Stored size: 1004 Bytes
Contents
module SandthornDriverSequel::Errors Error = Class.new(StandardError) InternalError = Class.new(Error) NoAggregateError = Class.new(Error) EventFormatError = Class.new(Error) class ConcurrencyError < Error attr_reader :event, :aggregate def initialize(event, aggregate) @event = event @aggregate = aggregate super(create_message) end def create_message "#{aggregate.aggregate_type} with id #{aggregate.aggregate_id}: " + "expected event with version #{aggregate.aggregate_version}, but got #{event.aggregate_version}" end end class WrongAggregateVersionError < Error; def initialize(aggregate, version) @aggregate = aggregate @version = version super(create_message) end def create_message "#{@aggregate[:aggregate_type]} with id #{@aggregate[:aggregate_id]}" + " should be at version #{@version}" + " but was #{@aggregate[:aggregate_version]} in the event store." end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sandthorn_driver_sequel-4.1.0 | lib/sandthorn_driver_sequel/errors.rb |
sandthorn_driver_sequel-4.0.0 | lib/sandthorn_driver_sequel/errors.rb |