Exception: PgEventstore::NotPersistedEventError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#as_json, #to_h

Constructor Details

#initialize(event) ⇒ NotPersistedEventError



199
200
201
202
# File 'lib/pg_eventstore/errors.rb', line 199

def initialize(event)
  @event = event
  super(user_friendly_message)
end

Instance Attribute Details

#eventObject

Returns the value of attribute event.



196
197
198
# File 'lib/pg_eventstore/errors.rb', line 196

def event
  @event
end

Instance Method Details

#user_friendly_messageString



205
206
207
# File 'lib/pg_eventstore/errors.rb', line 205

def user_friendly_message
  "Event with #id #{event.id.inspect} must be present, but it could not be found."
end