Exception: PgEventstore::RecordNotFound

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(table_name, id) ⇒ RecordNotFound

Returns a new instance of RecordNotFound.

Parameters:

  • table_name (String)
  • id (Integer, String)


121
122
123
124
125
# File 'lib/pg_eventstore/errors.rb', line 121

def initialize(table_name, id)
  @table_name = table_name
  @id = id
  super(user_friendly_message)
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



117
118
119
# File 'lib/pg_eventstore/errors.rb', line 117

def id
  @id
end

#table_nameObject

Returns the value of attribute table_name.



114
115
116
# File 'lib/pg_eventstore/errors.rb', line 114

def table_name
  @table_name
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


128
129
130
# File 'lib/pg_eventstore/errors.rb', line 128

def user_friendly_message
  "Could not find/update #{table_name.inspect} record with #{id.inspect} id."
end