Exception: EventStoreClient::StreamDeletionError

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(stream_name, details:) ⇒ StreamDeletionError

Returns a new instance of StreamDeletionError.

Parameters:

  • stream_name (String)
  • details (String)


95
96
97
98
99
# File 'lib/event_store_client/errors.rb', line 95

def initialize(stream_name, details:)
  @stream_name = stream_name
  @details = details
  super(user_friendly_message)
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



91
92
93
# File 'lib/event_store_client/errors.rb', line 91

def details
  @details
end

#stream_nameObject (readonly)

Returns the value of attribute stream_name.



91
92
93
# File 'lib/event_store_client/errors.rb', line 91

def stream_name
  @stream_name
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


102
103
104
105
106
107
108
# File 'lib/event_store_client/errors.rb', line 102

def user_friendly_message
  <<~TEXT.strip
    Could not delete #{stream_name.inspect} stream. It seems that a stream with that \
    name does not exist, has already been deleted or its state does not match the \
    provided :expected_revision option. Please check #details for more info.
  TEXT
end