Exception: PgEventstore::TooManyRecordsToLockError

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

Returns a new instance of TooManyRecordsToLockError.

Parameters:



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

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

Instance Attribute Details

#number_of_recordsObject (readonly)

Returns the value of attribute number_of_records.



232
233
234
# File 'lib/pg_eventstore/errors.rb', line 232

def number_of_records
  @number_of_records
end

#streamObject (readonly)

Returns the value of attribute stream.



231
232
233
# File 'lib/pg_eventstore/errors.rb', line 231

def stream
  @stream
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


243
244
245
# File 'lib/pg_eventstore/errors.rb', line 243

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