Exception: PgEventstore::RecordNotFound

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

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 (Object)


244
245
246
247
248
# File 'lib/pg_eventstore/errors.rb', line 244

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.

Returns:

  • (Object)


240
241
242
# File 'lib/pg_eventstore/errors.rb', line 240

def id
  @id
end

#table_nameString

Returns the value of attribute table_name.

Returns:

  • (String)


237
238
239
# File 'lib/pg_eventstore/errors.rb', line 237

def table_name
  @table_name
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


251
252
253
# File 'lib/pg_eventstore/errors.rb', line 251

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