Exception: EventStoreClient::WrongExpectedVersionError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#as_json, #to_h

Constructor Details

#initialize(wrong_expected_version, caused_by:) ⇒ WrongExpectedVersionError

Returns a new instance of WrongExpectedVersionError.

Parameters:

  • wrong_expected_version (EventStore::Client::Streams::AppendResp::WrongExpectedVersion)
  • caused_by (EventStoreClient::DeserializedEvent)

    an event on which WrongExpectedVersionError error happened. It can be useful when appending array of events - based on it you will know which events were appended and which weren’t.



41
42
43
44
45
# File 'lib/event_store_client/errors.rb', line 41

def initialize(wrong_expected_version, caused_by:)
  @wrong_expected_version = wrong_expected_version
  @caused_by = caused_by
  super(user_friendly_message)
end

Instance Attribute Details

#caused_byObject (readonly)

Returns the value of attribute caused_by.



35
36
37
# File 'lib/event_store_client/errors.rb', line 35

def caused_by
  @caused_by
end

#wrong_expected_versionObject (readonly)

Returns the value of attribute wrong_expected_version.



35
36
37
# File 'lib/event_store_client/errors.rb', line 35

def wrong_expected_version
  @wrong_expected_version
end