Exception: PgEventstore::TooManyRecordsToLockError

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(stream, number_of_records) ⇒ TooManyRecordsToLockError

Returns a new instance of TooManyRecordsToLockError.

Parameters:



359
360
361
362
363
# File 'lib/pg_eventstore/errors.rb', line 359

def initialize(stream, number_of_records)
  @stream = stream
  @number_of_records = number_of_records
  super(user_friendly_message)
end

Instance Attribute Details

#number_of_recordsInteger

Returns the value of attribute number_of_records.

Returns:

  • (Integer)


355
356
357
# File 'lib/pg_eventstore/errors.rb', line 355

def number_of_records
  @number_of_records
end

#streamStream

Returns the value of attribute stream.

Returns:



354
355
356
# File 'lib/pg_eventstore/errors.rb', line 354

def stream
  @stream
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


366
367
368
# File 'lib/pg_eventstore/errors.rb', line 366

def user_friendly_message
  "Too many records of #{stream.to_hash.inspect} stream to lock: #{number_of_records}"
end